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 | 287a34ae0dfc23e4158f67cb7783d239f202c368 (patch) | |
tree | 5e35d5b41aae961b37cf6632f60c42f51c7aa775 /ext/tk/sample/bindtag_sample.rb | |
parent | 9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff) | |
download | ruby-287a34ae0dfc23e4158f67cb7783d239f202c368.tar.gz |
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/bindtag_sample.rb')
-rw-r--r-- | ext/tk/sample/bindtag_sample.rb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/ext/tk/sample/bindtag_sample.rb b/ext/tk/sample/bindtag_sample.rb index 8c93b4a260..b13364bb68 100644 --- a/ext/tk/sample/bindtag_sample.rb +++ b/ext/tk/sample/bindtag_sample.rb @@ -2,18 +2,18 @@ require 'tk' TkLabel.new(:text=><<EOT, :justify=>:left).pack -This is a sample of bindtags and usage of -Tk.callback_break/Tk.callback_continue. -Please check the work of following buttons -(attend the difference between before/after - pressing the bottom button), and see the +This is a sample of bindtags and usage of +Tk.callback_break/Tk.callback_continue. +Please check the work of following buttons +(attend the difference between before/after + pressing the bottom button), and see the source code. EOT def set_class_bind - TkButton.bind('ButtonPress-1', + TkButton.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of TkButton class'}) - TkButton.bind('ButtonRelease-1', + TkButton.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of TkButton class'}) end @@ -23,21 +23,21 @@ r.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of root widget'}) r.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of root widget'}) # set 'all' binding -TkBindTag::ALL.bind('ButtonPress-1', +TkBindTag::ALL.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of the tag "all"'}) -TkBindTag::ALL.bind('ButtonRelease-1', +TkBindTag::ALL.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of the tag "all"'}) # create buttons -b1 = TkButton.new(:text=>'button-1', +b1 = TkButton.new(:text=>'button-1', :command=>proc{puts "command of button-1"}).pack -b2 = TkButton.new(:text=>'button-2', +b2 = TkButton.new(:text=>'button-2', :command=>proc{puts "command of button-2"}).pack -b3 = TkButton.new(:text=>'button-3', +b3 = TkButton.new(:text=>'button-3', :command=>proc{puts "command of button-3"}).pack -b4 = TkButton.new(:text=>'button-4', +b4 = TkButton.new(:text=>'button-4', :command=>proc{puts "command of button-4"}).pack -b5 = TkButton.new(:text=>'button-5', +b5 = TkButton.new(:text=>'button-5', :command=>proc{puts "command of button-5"}).pack # set button binding @@ -62,14 +62,14 @@ tag1.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of tag1'}) tag1.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of tag1'}) tag2 = TkBindTag.new -tag2.bind('ButtonPress-1', +tag2.bind('ButtonPress-1', proc{ puts 'bind "ButtonPress-1" of tag2' puts 'call Tk.callback_continue' Tk.callback_continue puts 'never see this message' }) -tag2.bind('ButtonRelease-1', +tag2.bind('ButtonRelease-1', proc{ puts 'bind "ButtonRelease-1" of tag2' puts 'call Tk.callback_continue' @@ -78,14 +78,14 @@ tag2.bind('ButtonRelease-1', }) tag3 = TkBindTag.new -tag3.bind('ButtonPress-1', +tag3.bind('ButtonPress-1', proc{ puts 'bind "ButtonPress-1" of tag3' puts 'call Tk.callback_break' Tk.callback_break puts 'never see this message' }) -tag3.bind('ButtonRelease-1', +tag3.bind('ButtonRelease-1', proc{ puts 'bind "ButtonRelease-1" of tag3' puts 'call Tk.callback_break' @@ -117,7 +117,7 @@ p b4.bindtags b5.bindtags([tag1, TkButton, tag2, b5]) # create button to set button class binding -TkButton.new(:text=>'set binding to TkButton class', +TkButton.new(:text=>'set binding to TkButton class', :command=>proc{ puts 'call "set_class_bind"' set_class_bind |