diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
| commit | d17d1b111341f2c8979cf8fbd63ec7ec9db7c3ad (patch) | |
| tree | 5e35d5b41aae961b37cf6632f60c42f51c7aa775 /ext/tk/sample/cd_timer.rb | |
| parent | 101e79d7b434c01c0e6f4bcc480003858ab8e1a4 (diff) | |
| download | ruby-d17d1b111341f2c8979cf8fbd63ec7ec9db7c3ad.tar.gz ruby-d17d1b111341f2c8979cf8fbd63ec7ec9db7c3ad.tar.xz ruby-d17d1b111341f2c8979cf8fbd63ec7ec9db7c3ad.zip | |
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/cd_timer.rb')
| -rw-r--r-- | ext/tk/sample/cd_timer.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/tk/sample/cd_timer.rb b/ext/tk/sample/cd_timer.rb index 9154e89bf..e2611fbf2 100644 --- a/ext/tk/sample/cd_timer.rb +++ b/ext/tk/sample/cd_timer.rb @@ -7,23 +7,23 @@ require 'tk' if ARGV.empty? - $stderr.puts 'Error:: No time arguments for counting down' + $stderr.puts 'Error:: No time arguments for counting down' exit(1) end width = 10 -TkButton.new(:text=>'exit', +TkButton.new(:text=>'exit', :command=>proc{exit}).pack(:side=>:bottom, :fill=>:x) b = TkButton.new(:text=>'start').pack(:side=>:top, :fill=>:x) f = TkFrame.new(:relief=>:ridge, :borderwidth=>2).pack(:fill=>:x) -TkLabel.new(f, :relief=>:flat, :pady=>3, - :background=>'black', :foreground=>'white', +TkLabel.new(f, :relief=>:flat, :pady=>3, + :background=>'black', :foreground=>'white', :text=>' elapsed: ').pack(:fill=>:x, :side=>:left, :expand=>true) -now = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, - :background=>'black', :foreground=>'white', +now = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, + :background=>'black', :foreground=>'white', :text=>'%4d:%02d.00' % [0, 0]).pack(:side=>:right) timers = [ TkRTTimer.new(10){|tm| @@ -41,9 +41,9 @@ timers = [ TkRTTimer.new(10){|tm| ARGV.collect{|arg| (Float(arg) * 60).to_i}.sort.each_with_index{|time, idx| f = TkFrame.new(:relief=>:ridge, :borderwidth=>2).pack(:fill=>:x) - TkLabel.new(f, :relief=>:flat, :pady=>3, + TkLabel.new(f, :relief=>:flat, :pady=>3, :text=>' %4d:%02d --> ' % (time.divmod(60))).pack(:side=>:left) - l = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, + l = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w, :text=>'%4d:%02d' % (time.divmod(60))).pack(:side=>:right) timers << TkRTTimer.new(1000){|tm| t = (tm.return_value || time) - 1 |
