home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- 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
- From: keith@taligent.com (Keith Rollin)
- Subject: Re: WaitNextEvent availability
- Message-ID: <keith-121192144852@kip-16.taligent.com>
- Followup-To: comp.sys.mac.programmer
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Organization: Taligent
- References: <1dsp39INN9sq@huon.itd.adelaide.edu.au> <1992Nov12.180837.11646@midway.uchicago.edu>
- Date: Thu, 12 Nov 1992 22:55:25 GMT
- Lines: 37
-
- In article <1992Nov12.180837.11646@midway.uchicago.edu>,
- merv@ellis.uchicago.edu (garrett marvin derner) wrote:
- >
- > In 'Macintosh Programming Secrets' by Knaster & Rollin, it's solved
- > this way:
- >
- > #define WNE_TRAP_NUM 0x60
- > #define UNIMPL_TRAP_NUM 0x9F
- > . . .
- > Boolean gWNEImplemented;
- > . . .
- > gWNEImplemented = (NGetTrapAddress(WNE_TRAP_NUM, ToolTrap) !=
- > NGetTrapAddress(UNIMPL_TRAP_NUM, ToolTrap));
- > . . .
- > if( gWNEImplemented)
- > WaitNextEvent(everyEvent, &theEvent, MIN_SLEEP, NIL_MOUSE_REGION);
- > else {
- > SystemTask();
- > GetNextEvent( everyEvent, &theEvent);
- > }
-
- Uh, thanks for the attribution, but I'm afraid there's nothing like that in
- 'Macintosh Programming Secrets' by Knaster & Rollin. Perhaps in the first
- edition (by Scott only), but not in the second (by both of us). In our
- shell application, we check at the start of the application for
- WaitNextEvent by calling TrapExists (which has recently been posted here
- about 1000 times, so I won't do it again). If it is not implemented, we
- post an alert and quit.
-
- I think that the practice of using GetNextEvent if WaitNextEvent is not
- implemented is fading. I think that most people are requiring that
- WaitNextEvent exists. Mac DTS sample code supports this, too.
-
- -----
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-