Article View: comp.windows.x
Article #36873Re: Processing toolkit events
From: Tom Weinstein
Date: Thu, 15 Feb 1990 02:15
Date: Thu, 15 Feb 1990 02:15
38 lines
1782 bytes
1782 bytes
In article <2759@bacchus.dec.com> asente@decwrl.dec.com (Paul Asente) writes:
In article <3947@hub.UUCP> tom@bears.ucsb.edu writes:
>> XEvent event;
>>
>> while (XtAppPending(context)) {
>> XtAppNextEvent(context, &event);
>> XtDispatchEvent(&event);
>> }
>>However, this seems to block when there are no events in the queue. Am
>>I doing something wrong, or is this a bug?
>Are you using timers or alternate input sources? XtAppPending returns
>non-zero when these exist but XtAppNextEvent still blocks if there are no
>X events. If this is the case, you might try
> while (XtAppPending(context) & XtIMXEvent) {
> ...
I just figured out the right way to do this:
XEvent event;
XtInputMask mask;
XFlush(XtDisplay(xchippe));
while (mask = XtAppPending(context))
XtAppProcessEvent(context, mask);
This way it doesn't block, and it processes everything including timers.
Thanks for the help!
> -paul asente
> asente@decwrl.dec.com decwrl!asente
--
It does not do to leave a dragon | Tom Weinstein ...ucbvax!hub!ucsbuxa!6600tom
out of your calculations, if you | 6600tom@ucsbuxa.bitnet tom@bears.ucsb.edu
live near him. --J.R.R. Tolkien | 6600tom@ucsbuxa.ucsb.edu tomw@cornu.ucsb.edu
Technical Details
Message-ID:
<3953@hub.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!hub!tomReferences:
<3947@hub.UUCP> <2759@bacchus.dec.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!hub!tom From: tom@capella.ucsb.edu (Tom Weinstein) Newsgroups: comp.windows.x Subject: Re: Processing toolkit events Message-ID: <3953@hub.UUCP> Date: 15 Feb 90 02:15:38 GMT References: <3947@hub.UUCP> <2759@bacchus.dec.com> Sender: news@hub.UUCP Reply-To: tom@bears.ucsb.edu Distribution: comp Organization: Kingdom of Oz, Department of Wizardry Lines: 38 In-reply-to: asente@decwrl.dec.com's message of 15 Feb 90 00:11:10 GMT