Class: GLib::Timeout

Inherits:
Object show all
Defined in:
lib/knj/jruby-gtk2/gtk2.rb,
lib/knj/ironruby-gtk2/glib.rb

Class Method Summary collapse

Class Method Details

.add(time, &block) ⇒ Object



229
230
231
232
233
234
235
236
237
238
239
# File 'lib/knj/jruby-gtk2/gtk2.rb', line 229

def self.add(time, &block)
  Thread.new(time, block) do |time, block|
    begin
      sleep(time / 1000)
      block.call
    rescue Exception => e
      puts e.inspect
      puts e.backtrace
    end
  end
end