Timer event with callback

Greetings,
There is an excellent Timer in Tk, called TkRtTimer. The functionality
is elegant: It has a callback after an elapsed amount of time.

http://www.ruby-doc.org/stdlib-2.0.0/libdoc/tk/rdoc/TkRTTimer.html

When I try and include ‘tk’ in a visual ruby project I get into big
trouble.
Does anyone have suggestions about how to get TKRTTimer to work in
visual ruby?
If the task is herculean or unlikely what are the possible solutions?
Most grateful for any help.

Experimenting with EventMachine timers. This would appear to need to run
as a new thread in parallel with the GUI.

Sorry to bother, using Rufus-Scheduler
Seems to work nicely.

Andru M. wrote in post #1126902:

Greetings,
There is an excellent Timer in Tk, called TkRtTimer. The functionality
is elegant: It has a callback after an elapsed amount of time.

there is :
GLib::Timeout.add(n) { block }

which do the job. Doc :
http://ruby-gnome2.sourceforge.jp/hiki.cgi?GLib::Timeout
and
https://developer.gnome.org/glib/2.37/glib-The-Main-Event-Loop.html#g-timeout-add

Thanks Regis!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs