Allows you to add work procedures and timer procedures to your application. These procedures are useful if your application requires tasks beyond processing events from the user.
A work procedure is a callback function that provides a limited form of background processing. The work procedure is invoked by the Xt Intrinsics whenever no other events are pending. That is, when X is idle (not drawing to the display or responding to user actions), the work procedure is called.
Use a work procedure to specify a function to call when no other events are pending. Once called, a work procedure monopolizes the CPU. Therefore, a work procedure should be a function that executes quickly. Otherwise, the display stops responding to the user while the work procedure executes. For example, to perform a long calculation with work procedures, set up the calculation as an iterative process. Then, a small portion of the calculation can be done each time the work procedure is called. This approach avoids freezing the display.
A timer procedure is a callback procedure that you register. A timer procedure is invoked by the Xt Intrinsics when the interval of time that you specified elapses. When a timeout event occurs, the Intrinsics invokes the timer callback procedure, and the Intrinsics automatically removes the callback. Timeout events are invoked only once.
Use a timer procedure for an event that you want to happen periodically, but not continuously. When the timer procedure is registered, Xt first waits for at least the interval you specified, and then calls the timer procedure.
and specify the interval of time that should elapse before this function is invoked. The interval of time is specified in milliseconds. After this interval elapses, the
proc callback function is invoked by Xt Intrinsics. The
client_dataparameter specifies client data passed to
proc . XtAppAddTimeOut returns an ID that identifies the timer procedure.
Note: To call proc repeatedly, you must re-register the timeout within the proc procedure.