Name
XtAppMainLoop — process input from a given application.
Synopsis
void XtAppMainLoop(app_context)
XtAppContext app_context;
Arguments
app_context
Specifies the application context that identifies the application.
Description
XtAppMainLoop first reads the next incoming X event by calling XtAppNextEvent and dispatches it to the appropriate registered procedure by calling XtDispatchEvent. This constitutes the main loop of X Toolkit applications, and as such, it does not return. Applications are expected to exit in response to some user action.
There is nothing special about XtAppMainLoop; it is simply an infinite loop that calls XtAppNextEvent and then XtDispatchEvent. An application can provide its own version of this loop. For example, it might test an application-dependent global flag or other termination condition before looping back and calling XtAppNextEvent. For example, if the number of top-level widgets drops to zero, the application may be able to exit safely.
See XtAppAddWorkProc for information on how to spend idle time.