Article View: comp.sys.next.programmer
Article #1903Re: NeXT Event Loop Question
From: Sam Streeper
Date: Tue, 24 Nov 1992 01:38
Date: Tue, 24 Nov 1992 01:38
27 lines
1742 bytes
1742 bytes
west@turing.toronto.edu (Tom West) writes:
> I am porting over an interpreter to the NeXT. (...)
> Rather kindly, the execution process does come up for air fairly regularly.
> Looks like: do
> {
> running = Execute ();
> } while (running != FINISHED)
In the past you have been simply polling the execution loop from the event
loop. The event loop is rather more hidden under NeXTstep, but you can get the
same effect by installing a timed entry that runs the Execute() loop.
Timed entries happen "between" the dispatch of normal events (like keypresses).
You must specify the interval at which you want to invoke the function
(presumably a very small value in your case). One thing to be aware of is that
timed entries normally can go off any time you ask for an event (like "what is
the next key?") A timed entry will never directly reenter the handler function
(that is, the function is locked out until the timed entry returns) but it
could happen if you call the Execute() handler responding to a key-down event
and you look for another event. If you need to do this, a simple semaphore
will keep you happy. Oh yeah, the documentation is under DPSAddTimedEntry().
-sam
--
Opinions expressed herein are not those of my employer. They're not even
mine. They're probably wrong besides. How did they get in here, anyway?
Technical Details
Message-ID:
<5930@rosie.NeXT.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!rosie!NeXT.comReferences:
<1992Nov20.182445.9500@jarvis.csri.toronto.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!rosie!NeXT.com From: sam_s@NeXT.com (Sam Streeper) Newsgroups: comp.sys.next.programmer Subject: Re: NeXT Event Loop Question Message-ID: <5930@rosie.NeXT.COM> Date: 24 Nov 92 01:38:03 GMT References: <1992Nov20.182445.9500@jarvis.csri.toronto.edu> Sender: news@NeXT.COM Reply-To: sam_s@NeXT.com Lines: 27