home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18342 < prev    next >
Encoding:
Text File  |  1992-11-12  |  1.9 KB  |  50 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!pageworks.com!world!eff!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!taligent!kip-16.taligent.com!user
  3. From: keith@taligent.com (Keith Rollin)
  4. Subject: Re: WaitNextEvent availability
  5. Message-ID: <keith-121192144852@kip-16.taligent.com>
  6. Followup-To: comp.sys.mac.programmer
  7. Sender: usenet@taligent.com (More Bytes Than You Can Read)
  8. Organization: Taligent
  9. References: <1dsp39INN9sq@huon.itd.adelaide.edu.au> <1992Nov12.180837.11646@midway.uchicago.edu>
  10. Date: Thu, 12 Nov 1992 22:55:25 GMT
  11. Lines: 37
  12.  
  13. In article <1992Nov12.180837.11646@midway.uchicago.edu>,
  14. merv@ellis.uchicago.edu (garrett marvin derner) wrote:
  15. > In 'Macintosh Programming Secrets' by Knaster & Rollin, it's solved
  16. > this way:
  17. > #define WNE_TRAP_NUM      0x60
  18. > #define UNIMPL_TRAP_NUM   0x9F
  19. > . . .
  20. > Boolean    gWNEImplemented;
  21. > . . .
  22. >     gWNEImplemented = (NGetTrapAddress(WNE_TRAP_NUM, ToolTrap) !=
  23. >                        NGetTrapAddress(UNIMPL_TRAP_NUM, ToolTrap));
  24. > . . .
  25. >     if( gWNEImplemented)
  26. >         WaitNextEvent(everyEvent, &theEvent, MIN_SLEEP, NIL_MOUSE_REGION);
  27. >     else  {
  28. >         SystemTask();
  29. >         GetNextEvent( everyEvent, &theEvent);
  30. >     }
  31.  
  32. Uh, thanks for the attribution, but I'm afraid there's nothing like that in
  33. 'Macintosh Programming Secrets' by Knaster & Rollin. Perhaps in the first
  34. edition (by Scott only), but not in the second (by both of us). In our
  35. shell application, we check at the start of the application for
  36. WaitNextEvent by calling TrapExists (which has recently been posted here
  37. about 1000 times, so I won't do it again). If it is not implemented, we
  38. post an alert and quit.
  39.  
  40. I think that the practice of using GetNextEvent if WaitNextEvent is not
  41. implemented is fading. I think that most people are requiring that
  42. WaitNextEvent exists. Mac DTS sample code supports this, too.
  43.  
  44. -----
  45. Keith Rollin
  46. Phantom Programmer
  47. Taligent, Inc.
  48.