Adding Timers
A timerADD parameter.
timerid = WtTimer("ADD", interval, timer, [client_data])
The interval parameter specifies the time interval, in milliseconds, until the PV-WAVE procedure timer callback timer is invoked. The WtTimer routine, unlike the Xt TimeOut function, restarts itself when the timer callback procedure is called. To stop the timer, use the following command in the timer callback:
status=WtTimer("REMOVE", timerid)
The application can optionally use the client_data procedure to specify some application-defined data to be passed to the timer callback procedure when the callback is invoked. If client_data is a local variable (defined only in the current procedure), a copy of that variable is created and passed (passed by value). If client_data is a global variable (defined in a
The form of Widget Toolbox timer procedures is:
PRO TimerProc, widget, client_data, nparams, timerid, time
where:
widget—The top application shell widget ID.
client_data—The client_data passed to WtTimer.
nparams—The number of timer-specific parameters after nparams. (This number is always 2, for timerid and time.)
timerid—The unique timer ID.
time—The time interval in milliseconds.
Example
common timer, tid
.
.
id=WtTimer("ADD", 100, 'TimerCallback', my_data)PRO TimerCallback, wid, client_data, nparams, timer_id, interval
COMMON timer, tid
tid = timer_id
.
.
END