summaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/demos-en/timer
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-02 05:04:30 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-02 05:04:30 +0000
commit01d614d05fa34345e9c8e1521684984aaaa05658 (patch)
tree92b661314bdfd045882e365e3e43b77f57244725 /ext/tk/sample/demos-en/timer
parente3689350394195b3d82013f58a586d5f461cc6b8 (diff)
downloadruby-01d614d05fa34345e9c8e1521684984aaaa05658.tar.gz
ruby-01d614d05fa34345e9c8e1521684984aaaa05658.tar.xz
ruby-01d614d05fa34345e9c8e1521684984aaaa05658.zip
* (bug fix) TkEntry#delete
* (bug fix) some widget demos * support <TkVariable object> == <Symbol> ( "coerce TkVariable" add to the TODO list :-) ) * freeze some object for security reason git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/demos-en/timer')
-rw-r--r--ext/tk/sample/demos-en/timer20
1 files changed, 18 insertions, 2 deletions
diff --git a/ext/tk/sample/demos-en/timer b/ext/tk/sample/demos-en/timer
index 896568c0b..58a41d00c 100644
--- a/ext/tk/sample/demos-en/timer
+++ b/ext/tk/sample/demos-en/timer
@@ -80,12 +80,28 @@ end
class ButtonFrame < TkFrame
def initialize(parent=nil,keys=nil)
super(parent,keys)
+=begin
@stop = TkButton.new(self,
'text'=>'Stop',
'command'=>proc{timer_stop})
@start = TkButton.new(self,
'text'=>'Start',
'command'=>proc{timer_start})
+=end
+ @stop = TkButton.new(self, :text=>'Stop', :state=>:disabled)
+ @start = TkButton.new(self, :text=>'Start', :state=>:normal)
+
+ @stop.command proc{
+ timer_stop
+ @start.state(:normal)
+ @stop.state(:disabled)
+ }
+ @start.command proc{
+ timer_start
+ @stop.state(:normal)
+ @start.state(:disabled)
+ }
+
@reset = TkButton.new(self,
'text'=>'Reset',
'command'=>proc{timer_reset})
@@ -99,8 +115,8 @@ end
class Timer < TkRoot
attr_reader :countframe
- def initialize
- super
+ def initialize(*args)
+ super(*args)
@countframe = CountFrame.new(self)
@buttonframe = ButtonFrame.new(self)
for f in [@buttonframe,@countframe]