#include <tcl.h> Tcl_CreateModalTimeout(milliseconds, proc, clientData) Tcl_DeleteModalTimeout(proc, clientData)
Tcl_CreateModalTimeout behaves just like Tcl_CreateTimerHandler except that it creates a modal timeout. Its arguments have the same meaning as for Tcl_CreateTimerHandler and proc is invoked just as for Tcl_CreateTimerHandler. Tcl_DeleteModalTimeout deletes the most recently created modal timeout; its arguments must match the corresponding arguments to the most recent call to Tcl_CreateModalTimeout.
Modal timeouts differ from a normal timers in three ways. First, they will trigger regardless of whether the TCL_TIMER_EVENTS flag has been passed to Tcl_DoOneEvent. Typically modal timers are used with the TCL_TIMER_EVENTS flag off so that normal timers don't fire but modal ones do. Second, if several modal timers have been created they stack: only the top timer on the stack (the most recently created one) is active at any point in time. Modal timeouts must be deleted in inverse order from their creation. Third, modal timeouts are not deleted when they fire: once a modal timeout has fired, it will continue firing every time Tcl_DoOneEvent is called, until the timeout is deleted by calling Tcl_DeleteModalTimeout.
Modal timeouts are only needed in a few special situations, and they should be used with caution.
Copyright © 1989-1994 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.