Class Ticker

Superclasses :
lang::Object
util::Connectable
Package :
gui

This class is used to generate "tick" events at regular intervals. These events will be fired between the handling of input and repaint events, so at least one dialog has to be open for the Ticker class to work.

The following will cause the method on_tick of object obj to be invoked roughly every 2 seconds.

Example :
t := Ticker()
t.connect(obj, "on_tick", TICK_EVENT)
t.start(2000)
Source

Class summary
Methods inherited from lang::Object
clone(seen) equals(other, seen) get_class() get_class_name() get_id() hash_code(depth, seen) is_instance(name) to_string(depth, seen)
Methods inherited from util::Connectable
connect(obj, meth, type) disconnect(l) fire(type, param) fire_event(e) initially()
Variables inherited from util::Connectable
listeners
Methods defined in this class
is_ticking() retime(n) start(n, d) stop() tick()
Variables defined in this class
next_tick_time ticker_rate

Method detail

is_ticking()

Succeeds if and only if the ticker is active.
Source

retime(n)

Change the interval of the ticker
Parameters :
n - the new interval.
Source

start(n, d)

Start the ticker process, with the tick() method being invoked approximately every n milliseconds.
Parameters :
n - the ticker interval in milliseconds.
d - the initial delay, if any (default 0)
Source

stop()

Stop the ticker.
Source

tick()

This method is called repeatedly by the dispatcher. It fires off events to its listeners.
Source

Variable detail

next_tick_time


ticker_rate