Reference Guide > W Routines > WwTimer Function
  

WwTimer Function
Registers a PV‑WAVE Widgets timer procedure.
Usage
status = WwTimer(time, timer_proc[, userdata])
Input Parameters
time — Specifies the time interval in milliseconds.
timer_proc — Specifies the name of a PV‑WAVE timer procedure.
userdata — (optional) User-defined data.
Returned Value
status — A value indicating success or failure of the timer registration.
*1 — Indicates success.
*0 — Indicates failure.
Keywords
None.
Timer Procedure Parameters
The following input parameters are required for the timer_proc callback procedure:
wid — The ID of the top-level widget.
userdata — User-defined data.
nparams — The number of parameters defined in the WwAlert call
timerid — The timer interrupt id. Used to remove a timer process, as in:
status = WtTimer("REMOVE", timerid)
time — An integer specifying the time interval, in milliseconds
Discussion
This procedure relies on the WtTimer procedure to add a timer in Once_Only mode (the timer procedure is executed only once after the specified time interval).
Example
This example comes from the code for the WzAnimate VDA Tool. The procedure shown in this example is used by the WzAnimate VDA Tool to restart the timer.
PRO WzAnimateStartTimer, tool_name
   ; Forward declaration of function.
   DECLARE FUNC, TmGetAttribute
   DECLARE FUNC, TmSetAttribute
   delay = TmGetAttribute(tool_name, 'TM', 'DELAY')
   timerid = WwTimer(delay, 'WzAnimateTimerCB', tool_name)
   tmp = TmSetAttribute(tool_name, 'TM', 'TIMER', 1B)
END
See Also
WtTimer

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.