I want to process and event at regular time intervals. It appears that
Wx::Timer should do the job, but I haven’t been able to figure out how
to use in in wxruby. The documentation for this is still for C++. I’ve
tried the following:
(In my form class’s initialize method): @timer = Wx::Timer.new
evt_timer(@timer.id) {|event| onTimer(event)} @timer.start(1000)
Later in the form, I have the onTimer routine defined. The problem is
that its never being called.
I want to process and event at regular time intervals. It appears that
Wx::Timer should do the job, but I haven’t been able to figure out how
to use in in wxruby. The documentation for this is still for C++. I’ve
tried the following:
(In my form class’s initialize method): @timer = Wx::Timer.new
evt_timer(@timer.id) {|event| onTimer(event)} @timer.start(1000)
Later in the form, I have the onTimer routine defined. The problem is
that its never being called.
I want to process and event at regular time intervals. It appears that
Wx::Timer should do the job, but I haven’t been able to figure out how
to use in in wxruby. The documentation for this is still for C++.
The introductory documentation here: http://wxruby.rubyforge.org/doc/timer.html is correct for Ruby (though
it seems to have a few formatting errors). For what you want the best
way would be as the first example on that page:
Wx::Timer.every(500) do
puts “Tick”
end
hth
alex
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.