Class: Shoes::Swt::Timer

Inherits:
Object
  • Object
show all
Defined in:
shoes-swt/lib/shoes/swt/timer.rb

Instance Method Summary collapse

Constructor Details

#initialize(dsl, app, blk) ⇒ Timer

Returns a new instance of Timer


6
7
8
9
10
11
12
# File 'shoes-swt/lib/shoes/swt/timer.rb', line 6

def initialize(dsl, app, blk)
  @blk = blk
  task = proc do
    eval_block unless app.real.disposed?
  end
  ::Swt.display.timer_exec(dsl.n, task)
end

Instance Method Details

#eval_blockObject


14
15
16
# File 'shoes-swt/lib/shoes/swt/timer.rb', line 14

def eval_block
  @blk.call
end