XtAppAddWorkProc — register a work procedure for a given application.
Synopsis
XtWorkProcId XtAppAddWorkProc(app_context, proc, client_data)
XtAppContext app_context;
XtWorkProc proc;
XtPointer client_data;
Arguments
app_context
Specifies the application context that identifies the application.
procSpecifies the procedure that is to be called when the application is idle.
client_data
Specifies the argument to be passed to the specified procedure when it is called.
Description
Xt supports a limited form of background processing. Most applications spend most of their time waiting for input; to do useful work during this idle time, you can register a work procedure that will run when the application would otherwise block in XtAppNextEvent or XtAppProcessEvent.
XtAppAddWorkProc adds the specified proc for the application identified by app_context. XtWorkProcId is an opaque identifier unique to this work procedure. Multiple work procedures can be registered, and the most recently added one is always the one that is called. However, if a work procedure itself adds another work procedure, the newly added one has lower priority than the current one.
Passing the XtWorkProcId returned from the XtWorkProc to XtRemoveWorkProc causes proc to stop being called.
Work procedures are of type XtWorkProc. XtWorkProc discusses the responsibilities of the application’s background processing routine. XtAddWorkProc is a simplified interface to this function.
See Also
XtAppNextEvent(1), XtAppProcessEvent(1), XtRemoveWorkProc(1),
XtWorkProc(2).