Is there some sample code on using using the Alarm object in Ruby?

There is an example in javascript, but I'd like to do it in Ruby.

Specifically, I want to do a callback and periodic intervals measured in hours and/or minutes.

John Kocurek

Evgeny Vovchenko
http://docs.rhomobile.com
Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


John Kocurek
Thanks for responding. That

Thanks for responding. That doesn't seem to work. Here is some code.

In my controller I created two methods.

def do_locate

    Rho::Timer.start(15000, (url_for :action => :timer_callback))

    render :action => :do_locate

end

  def timer_callback

    Alert.show_popup "Some message"

  end

The alert never happens.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


John Kocurek
Finally figured it out. I

Finally figured it out. I needed to do a WebView.refresh in the callback.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments