vis/animation/
mg_timer__define.pro
includes main-level programTimer class.
Examples
See the main-level example program:
IDL> .run mg_timer__define
IDL> timer = obj_new('MG_Timer', duration=1.0, nframes=5, $
callback='print', $
uvalue='Callback routine called')
IDL> timer->start
IDL>
Callback routine called
IDL>
Callback routine called
IDL>
Callback routine called
IDL>
Callback routine called
IDL>
Callback routine called
Class description for mg_timer
Properties
Properties in mg_timer
- active get type=boolean
whether the timer is currently running; read-only, use stop/start methods to change
- callback get set init type=string
procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property
- current_frame get set type=long
number of times the timer has already gone off
- duration get set init type=float
time in seconds between timer going off
- nframes get set init type=long
total number of times the timer should go off; defaults to 1
- repeating get set init type=boolean
set to repeat forever
- uvalue get set init type=any
user-defined value passed to callback routine
Routines
Routines from mg_timer__define.pro
mg_timer_event, event
Timer event handler.
mg_timer::getProperty, /active, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any
Get properties.
mg_timer::setProperty, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any
Set properties.
mg_timer::start
Start the timer.
mg_timer::stop
Stop the timer.
mg_timer::cleanup
Free resources.
result = mg_timer::init(duration=float, /repeating, nframes=long, callback=string, uvalue=any)
Create a timer instance.
mg_timer__define
Define instance variables.
Routine details
top mg_timer_event
mg_timer_event, event
Timer event handler.
Parameters
- event in required type=structure
timer event
top mg_timer::getProperty
mg_timer::getProperty, /active, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any
Get properties.
Keywords
- active type=boolean
whether the timer is currently running; read-only, use stop/start methods to change
- duration type=float
time in seconds between timer going off
- repeating type=boolean
set to repeat forever
- current_frame type=long
number of times the timer has already gone off
- nframes type=long
total number of times the timer should go off; defaults to 1
- callback type=string
procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property
- uvalue type=any
user-defined value passed to callback routine
top mg_timer::setProperty
mg_timer::setProperty, duration=float, /repeating, current_frame=long, nframes=long, callback=string, uvalue=any
Set properties.
Keywords
- duration type=float
time in seconds between timer going off
- repeating type=boolean
set to repeat forever
- current_frame type=long
number of times the timer has already gone off
- nframes type=long
total number of times the timer should go off; defaults to 1
- callback type=string
procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property
- uvalue type=any
user-defined value passed to callback routine
top mg_timer::init
result = mg_timer::init(duration=float, /repeating, nframes=long, callback=string, uvalue=any)
Create a timer instance.
Return value
1 for success, 0 for failure
Keywords
- duration type=float
time in seconds between timer going off
- repeating type=boolean
set to repeat forever
- nframes type=long
total number of times the timer should go off; defaults to 1
- callback type=string
procedure to call when timer goes off; this procedure should accept a single positional parameter which is the value of the UVALUE property
- uvalue type=any
user-defined value passed to callback routine
File attributes
Modification date: | Wed May 14 15:07:14 2014 |
Lines: | 82 |
Docformat: | rst rst |
Contact me if you have enhancement requests or bug fixes.