home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / next / programm / 5895 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.6 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!ibis!menu!tuna!usenet
  2. From: jml@visus.com (Jim Large)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: [NXApp run]
  5. Message-ID: <1992Aug31.143034.12176@visus.com>
  6. Date: 31 Aug 92 14:30:34 GMT
  7. References: <1992Aug25.092051@fdr.jsc.nasa.gov>
  8. Sender: usenet@visus.com (Usenet news reciever)
  9. Organization: Visual Understanding Systems, Pgh PA
  10. Lines: 42
  11. Nntp-Posting-Host: taco.visus.com
  12.  
  13. In article <1992Aug25.092051@fdr.jsc.nasa.gov> shirley@fdr.jsc.nasa.gov (Bill  
  14. Shirley [CSC]) writes:
  15. > Does the -run method of Application NEED to be invoked.
  16. > I need a little bit more control over the event loop.
  17.  
  18.   I've found that some desirable things happen when -[Application run] is
  19. called.  The only one I know about for sure is that the application's icon
  20. (which is highlighted when you launch the app) becomes unhighlighted.
  21.  
  22.   That's why I did the following when I had to port an alien program to
  23. NeXTStep:
  24.  
  25. @interface Controller:Object
  26. @end
  27.  
  28. @implementation Controller
  29. - appDidInit:sender {
  30.     [NXApp stop];
  31.     return self;
  32.     }
  33. @end
  34.  
  35. void main(
  36.   int argc,
  37.   char *argv[]
  38.   )
  39.   /*main*/ {
  40.     NXApp = ...
  41.     ...
  42.     [NXApp setDelegate:[[Controller alloc] init]];
  43.     [NXApp run];
  44.     while( 1 )
  45.       /*main loop*/ {
  46.         ...
  47.       /*main loop*/ }
  48.   /*main*/ }
  49.  
  50. ----------------+------------------+------------------------------------
  51.      |\ /|      |  Jim Large       |  Visual Understanding Systems, Inc.
  52.      | V |      |  jml@visus.com   |  2100 Wharton St.                  
  53.    \_|   |__    |  (412)488-3600   |  Pittsburgh, PA  15203             
  54.