diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-11 04:51:21 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-11 04:51:21 +0000 |
commit | 94d960beb57ead291992a6ceb34871b377ade1d1 (patch) | |
tree | 81258b81d9111c762cb80ca56141cd1f8ce9d0f9 /ext/tk/sample/demos-jp/menu84.rb | |
parent | 5716ff7b80b90b0c2aebcc1d41d8806aaf707bf3 (diff) |
* ext/tk/lib/tk/*: untabify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/demos-jp/menu84.rb')
-rw-r--r-- | ext/tk/sample/demos-jp/menu84.rb | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/ext/tk/sample/demos-jp/menu84.rb b/ext/tk/sample/demos-jp/menu84.rb index 78d4e68872..8c2a815d78 100644 --- a/ext/tk/sample/demos-jp/menu84.rb +++ b/ext/tk/sample/demos-jp/menu84.rb @@ -35,9 +35,9 @@ TkLabel.new($menu84_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left') { menustatus = TkVariable.new(" ") TkFrame.new($menu84_demo) {|frame| TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken', - 'bd'=>1, 'font'=>['Helvetica', '10'], - 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, - 'expand'=>true, 'fill'=>'both') + 'bd'=>1, 'font'=>['Helvetica', '10'], + 'anchor'=>'w').pack('side'=>'left', 'padx'=>2, + 'expand'=>true, 'fill'=>'both') pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2) } @@ -92,8 +92,8 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('command', 'label'=>'Long entry that does nothing') ['A','B','C','D','E','F','G'].each{|c| add('command', 'label'=>"Print letter \"#{c}\"", - 'underline'=>14, 'accelerator'=>"Meta+#{c}", - 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") + 'underline'=>14, 'accelerator'=>"Meta+#{c}", + 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}") $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"}) } } @@ -111,7 +111,7 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| TkMenu.new(m, 'tearoff'=>false) {|cascade_check| m.add('cascade', 'label'=>'Check button', - 'menu'=>cascade_check, 'underline'=>0) + 'menu'=>cascade_check, 'underline'=>0) oil = TkVariable.new(0) add('check', 'label'=>'オイル検査', 'variable'=>oil) trans = TkVariable.new(0) @@ -122,18 +122,18 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('check', 'label'=>'ライト検査', 'variable'=>lights) add('separator') add('command', 'label'=>'Show current values', - 'command'=>proc{showVars($menu84_demo, - ['オイル', oil], - ['トランスミッション', trans], - ['ブレーキ', brakes], - ['ライト', lights])} ) + 'command'=>proc{showVars($menu84_demo, + ['オイル', oil], + ['トランスミッション', trans], + ['ブレーキ', brakes], + ['ライト', lights])} ) invoke 1 invoke 3 } TkMenu.new(m, 'tearoff'=>false) {|cascade_radio| m.add('cascade', 'label'=>'Radio buttons', - 'menu'=>cascade_radio, 'underline'=>0) + 'menu'=>cascade_radio, 'underline'=>0) pointSize = TkVariable.new add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10) add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14) @@ -147,9 +147,9 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic') add('separator') add('command', 'label'=>'現在値の表示', - 'command'=>proc{showVars($menu84_demo, - ['pointSize', pointSize], - ['style', style])} ) + 'command'=>proc{showVars($menu84_demo, + ['pointSize', pointSize], + ['style', style])} ) invoke 1 invoke 7 } @@ -159,14 +159,14 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| $menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0) add('command', 'hidemargin'=>1, 'bitmap'=>'@'+[$demo_dir,'..', - 'images','pattern.xbm'].join(File::Separator), + 'images','pattern.xbm'].join(File::Separator), 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry', - 'text'=>'あなたが選択したメニュー項目は、文字列の代わりにビットマップイメージで項目を表示したものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', - 'bitmap'=>'', 'default'=>0, - 'buttons'=>'閉じる')} ) + 'text'=>'あなたが選択したメニュー項目は、文字列の代わりにビットマップイメージで項目を表示したものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', + 'bitmap'=>'', 'default'=>0, + 'buttons'=>'閉じる')} ) ['info', 'questhead', 'error'].each{|icon| add('command', 'bitmap'=>icon, 'hidemargin'=>1, - 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) + 'command'=>proc{print "You invoked the #{icon} bitmap\n"}) } entryconfigure(2, :columnbreak=>true) @@ -177,34 +177,34 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m| [ 'An entry','Another entry','Does nothing','Does almost nothing', 'Make life meaningful' ].each{|i| add('command', 'label'=>i, - 'command'=>proc{print "You invoked \"#{i}\"\n"}) + 'command'=>proc{print "You invoked \"#{i}\"\n"}) } m.entryconfigure('Does almost nothing', - 'bitmap'=>'questhead', 'compound'=>'left', - 'command'=>proc{ - TkDialog.new('title'=>'Compound Menu Entry', - 'message'=>'あなたが選択したメニュー項目は、ビットマップイメージと文字列とを同時に一つの項目に表示するようにしたものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', - 'buttons'=>['了解'], 'bitmap'=>'') - }) + 'bitmap'=>'questhead', 'compound'=>'left', + 'command'=>proc{ + TkDialog.new('title'=>'Compound Menu Entry', + 'message'=>'あなたが選択したメニュー項目は、ビットマップイメージと文字列とを同時に一つの項目に表示するようにしたものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。', + 'buttons'=>['了解'], 'bitmap'=>'') + }) } TkMenu.new($menu84_frame) {|m| $menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0) ['red', 'orange', 'yellow', 'green', 'blue'].each{|c| add('command', 'label'=>c, 'background'=>c, - 'command'=>proc{print "You invoked \"#{c}\"\n"}) + 'command'=>proc{print "You invoked \"#{c}\"\n"}) } } $menu84_demo.menu($menu84_frame) TkMenu.bind('<MenuSelect>', proc{|w| - begin - label = w.entrycget('active', 'label') - rescue - label = " " - end - menustatus.value = label - Tk.update(true) - }, '%W') + begin + label = w.entrycget('active', 'label') + rescue + label = " " + end + menustatus.value = label + Tk.update(true) + }, '%W') |