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/tkoptdb.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/tkoptdb.rb')
-rw-r--r-- | ext/tk/sample/tkoptdb.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb index 47784ea23..75c21e7e4 100644 --- a/ext/tk/sample/tkoptdb.rb +++ b/ext/tk/sample/tkoptdb.rb @@ -2,21 +2,21 @@ # # sample script of TkOptionDB # -# If 'LANG' environment variable's value is started by 'ja', -# then read Japanese resource data and display Japanese button text. -# In other case, read English resource data and display English text. +# If 'LANG' environment variable's value is started by 'ja', +# then read Japanese resource data and display Japanese button text. +# In other case, read English resource data and display English text. # require "tk" if __FILE__ == $0 || !TkCore::INTERP.safe? if ENV['LANG'] =~ /^ja/ # read Japanese resource - TkOptionDB.read_with_encoding(File.expand_path('resource.ja', - File.dirname(__FILE__)), + TkOptionDB.read_with_encoding(File.expand_path('resource.ja', + File.dirname(__FILE__)), 'euc-jp') else # read English resource - TkOptionDB.readfile(File.expand_path('resource.en', + TkOptionDB.readfile(File.expand_path('resource.en', File.dirname(__FILE__))) end end @@ -24,7 +24,7 @@ end # 'show_msg' and 'bye_msg' procedures can be defined on BTN_CMD resource. # Those procedures are called under $SAFE==2 cmd = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3) { - # If you want to check resource string (str), + # If you want to check resource string (str), # please define __check_proc_string__(str) like this. class << self def __check_proc_string__(str) @@ -40,12 +40,12 @@ cmd = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3) { # following two frame widgets use same database entry TkFrame.new(:class=>'BtnFrame'){|f| pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ + TkButton.new(:parent=>f, :widgetname=>'hello'){ command proc{ print "($SAFE=#{$SAFE} >>>) : " cmd.show_msg(TkOptionDB.inspect) print "(<<< $SAFE=#{$SAFE})" - } + } pack(:fill=>:x, :padx=>10, :pady=>10) } TkButton.new(:command=>proc{ @@ -53,7 +53,7 @@ TkFrame.new(:class=>'BtnFrame'){|f| cmd.bye_msg print "(<<< $SAFE=#{$SAFE} ) : " exit - }, + }, :parent=>f, :widgetname=>'quit'){ pack(:fill=>:x, :padx=>10, :pady=>10) } @@ -62,12 +62,12 @@ TkFrame.new(:class=>'BtnFrame'){|f| class BtnFrame < TkFrame; end BtnFrame.new{|f| pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ + TkButton.new(:parent=>f, :widgetname=>'hello'){ command proc{ print "($SAFE=#{$SAFE} >>>) : " cmd.show_msg(TkOptionDB.inspect) print "(<<< $SAFE=#{$SAFE})" - } + } pack(:fill=>:x, :padx=>10, :pady=>10) } TkButton.new(:command=>proc{ @@ -75,7 +75,7 @@ BtnFrame.new{|f| cmd.bye_msg print "(<<< $SAFE=#{$SAFE})" exit - }, + }, :parent=>f, :widgetname=>'quit'){ pack(:fill=>:x, :padx=>10, :pady=>10) } @@ -84,12 +84,12 @@ BtnFrame.new{|f| # if unknown class, use default option values TkFrame.new(:class=>'BtnFrame2'){|f| pack(:padx=>5, :pady=>5) - TkButton.new(:parent=>f, :widgetname=>'hello'){ + TkButton.new(:parent=>f, :widgetname=>'hello'){ command proc{ print "($SAFE=#{$SAFE} >>>) : " cmd.show_msg(TkOptionDB.inspect) print "(<<< $SAFE=#{$SAFE})" - } + } pack(:fill=>:x, :padx=>10, :pady=>10) } TkButton.new(:command=>proc{ @@ -97,7 +97,7 @@ TkFrame.new(:class=>'BtnFrame2'){|f| cmd.bye_msg print "(<<< $SAFE=#{$SAFE})" exit - }, + }, :parent=>f, :widgetname=>'quit'){ pack(:fill=>:x, :padx=>10, :pady=>10) } |