diff options
Diffstat (limited to 'ext/tk/sample/tktimer2.rb')
-rw-r--r-- | ext/tk/sample/tktimer2.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/tk/sample/tktimer2.rb b/ext/tk/sample/tktimer2.rb index dc4e8a6964..dd31bb098e 100644 --- a/ext/tk/sample/tktimer2.rb +++ b/ext/tk/sample/tktimer2.rb @@ -32,6 +32,10 @@ TkButton.new(:text=>'Start') { command proc{ timer.continue unless timer.running? } pack(:side=>:left, :fill=>:both, :expand=>true) } +TkButton.new(:text=>'Restart') { + command proc{ timer.restart(0, proc{ label.text('0.00'); 0 }) } + pack(:side=>:left, :fill=>:both, :expand=>true) +} TkButton.new(:text=>'Stop') { command proc{ timer.stop if timer.running? } pack('side'=>'right','fill'=>'both','expand'=>'yes') |