other versions
- wheezy 8.4.19-5
conflicting packages
Tcl_DoWhenIdle(3tcl) | Tcl Library Procedures | Tcl_DoWhenIdle(3tcl) |
NAME¶
Tcl_DoWhenIdle, Tcl_CancelIdleCall - invoke a procedure when there are no pending eventsSYNOPSIS¶
#include <tcl.h>Tcl_DoWhenIdle(proc, clientData)Tcl_CancelIdleCall(proc, clientData)
ARGUMENTS¶
- Tcl_IdleProc *proc (in)
- Procedure to invoke.
- ClientData clientData (in)
- Arbitrary one-word value to pass to proc.
DESCRIPTION¶
Tcl_DoWhenIdle arranges for proc to be invoked when the application becomes idle. The application is considered to be idle when Tcl_DoOneEvent has been called, couldn't find any events to handle, and is about to go to sleep waiting for an event to occur. At this point all pending Tcl_DoWhenIdle handlers are invoked. For each call to Tcl_DoWhenIdle there will be a single call to proc; after proc is invoked the handler is automatically removed. Tcl_DoWhenIdle is only usable in programs that use Tcl_DoOneEvent to dispatch events. Proc should have arguments and result that match the type Tcl_IdleProc:typedef void Tcl_IdleProc(ClientData clientData);
BUGS¶
At present it is not safe for an idle callback to reschedule itself continuously. This will interact badly with certain features of Tk that attempt to wait for all idle callbacks to complete. If you would like for an idle callback to reschedule itself continuously, it is better to use a timer handler with a zero timeout period.KEYWORDS¶
callback, defer, idle callback7.5 | Tcl |