home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / next / programm / 7386 < prev    next >
Encoding:
Internet Message Format  |  1992-11-24  |  1.7 KB

  1. Path: sparky!uunet!rosie!NeXT.com
  2. From: sam_s@NeXT.com (Sam Streeper)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: NeXT Event Loop Question
  5. Message-ID: <5930@rosie.NeXT.COM>
  6. Date: 24 Nov 92 01:38:03 GMT
  7. References: <1992Nov20.182445.9500@jarvis.csri.toronto.edu>
  8. Sender: news@NeXT.COM
  9. Reply-To: sam_s@NeXT.com
  10. Lines: 27
  11.  
  12. west@turing.toronto.edu (Tom West) writes:
  13. >   I am porting over an interpreter to the NeXT.  (...)
  14. >   Rather kindly, the execution process does come up for air fairly regularly.
  15. > Looks like:     do
  16. >             {
  17. >             running = Execute ();
  18. >         } while (running != FINISHED)
  19.  
  20. In the past you have been simply polling the execution loop from the event  
  21. loop.  The event loop is rather more hidden under NeXTstep, but you can get the  
  22. same effect by installing a timed entry that runs the Execute() loop.
  23.  
  24. Timed entries happen "between" the dispatch of normal events (like keypresses).   
  25. You must specify the interval at which you want to invoke the function  
  26. (presumably a very small value in your case).  One thing to be aware of is that  
  27. timed entries normally can go off any time you ask for an event (like "what is  
  28. the next key?")  A timed entry will never directly reenter the handler function  
  29. (that is, the function is locked out until the timed entry returns) but it  
  30. could happen if you call the Execute() handler responding to a key-down event  
  31. and you look for another event.  If you need to do this, a simple semaphore  
  32. will keep you happy.  Oh yeah, the documentation is under DPSAddTimedEntry().
  33.  
  34. -sam
  35.  
  36. --
  37. Opinions expressed herein are not those of my employer.  They're not even
  38. mine.  They're probably wrong besides.  How did they get in here, anyway?
  39.