# Copyright (c) 1990 The Regents of the University of California. # Copyright (c) 1994 Sun Microsystems, Inc. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # @(#) TimerHndlr.3 1.9 95/05/28 13:52:12 # =head1 NAME Tk_CreateTimerHandler, Tk_DeleteTimerHandler - call a procedure at a given time =for category C Programming =head1 SYNOPSIS B<#include Etk.hE> Tk_TimerToken B(I) B(I) =head1 ARGUMENTS =over 4 =item int milliseconds (in) How many milliseconds to wait before invoking I. =item Tk_TimerProc *proc (in) Procedure to invoke after I have elapsed. =item ClientData clientData (in) Arbitrary one-word value to pass to I. =item Tk_TimerToken token (in) Token for previously-created timer handler (the return value from some previous call to B). =back =head1 DESCRIPTION B arranges for I to be invoked at a time I milliseconds in the future. The callback to I will be made by B, so B is only useful in programs that dispatch events through B or through other Tk procedures that call B, such as B. The call to I may not be made at the exact time given by I: it will be made at the next opportunity after that time. For example, if B isn't called until long after the time has elapsed, or if there are other pending events to process before the call to I, then the call to I will be delayed. I should have arguments and return value that match the type B: =over 4 typedef void Tk_TimerProc(ClientData I); =back The I parameter to I is a copy of the I argument given to B when the callback was created. Typically, I points to a data structure containing application-specific information about what to do in I. B may be called to delete a previously-created timer handler. It deletes the handler indicated by I so that no call to I will be made; if that handler no longer exists (e.g. because the time period has already elapsed and I has been invoked) then B does nothing. =head1 KEYWORDS callback, clock, handler, timer