XtAppNextEvent()XtAppNextEvent()NameXtAppNextEvent - dispatch timer and alternate input event and return
the next X event.
Synopsis
void XtAppNextEvent(app_context, event_return)
XtAppContext app_context;
XEvent *event_return;
Inputs
app_context Specifies the application context.
Outputs
event_return
Returns the dequeued event structure.
Description
If there is an X event pending on any of the Displays in app_context,
XtAppNextEvent() returns that event in event_return. Otherwise, it
flushes the X output buffer of each Display, and if there is a back‐
ground work procedure registered (see XtAppAddWorkProc()), XtAppNex‐
tEvent() calls it and starts over by checking for pending events. If
there are no pending events and no work procedures, XtAppNextEvent()
blocks while waiting for input on any of the Display connections,
activity on any of the alternate input sources registered with XtAp‐
pAddInput(), or the expiration of any timers registered with XtAppAd‐
dTimeOut().
If there is activity on an alternate input source or if a timeout
interval elapses, XtAppNextEvent() calls the callback that was regis‐
tered with the input source or with the timer. If an X event occurs,
XtAppNextEvent() removes that event from the queue and returns it in
event_return.
Usage
Programs rarely need this much control over the event dispatching mech‐
anism. Most programs use XtAppMainLoop(). If you want to process a
single X, input, or timer event, consider XtAppProcessEvent().
See AlsoXtAppAddInput(1), XtAppAddTimeOut(1), XtAppAddWorkProc(1), XtAppMain‐
Loop(1), XtAppPeekEvent(1), XtAppPending(1), XtAppProcessEvent(1),
XtDispatchEvent(1).
Xt - Event Handling XtAppNextEvent()