diff options
Diffstat (limited to 'ext/tk/sample/demos-jp/bind.rb')
-rw-r--r-- | ext/tk/sample/demos-jp/bind.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb index 8985463b15..a1bcfdd2e7 100644 --- a/ext/tk/sample/demos-jp/bind.rb +++ b/ext/tk/sample/demos-jp/bind.rb @@ -16,8 +16,10 @@ $bind_demo = TkToplevel.new {|w| positionWindow(w) } +base_frame = TkFrame.new($bind_demo).pack(:fill=>:both, :expand=>true) + # frame 生成 -TkFrame.new($bind_demo) {|frame| +TkFrame.new(base_frame) {|frame| TkButton.new(frame) { #text '了解' text '閉じる' @@ -41,14 +43,14 @@ def tag_binding_for_bind_demo(tag, enter_style, leave_style) end # text 生成 -txt = TkText.new($bind_demo){|t| +txt = TkText.new(base_frame){|t| # 生成 setgrid 'true' #width 60 #height 24 font $font wrap 'word' - TkScrollbar.new($bind_demo) {|s| + TkScrollbar.new(base_frame) {|s| pack('side'=>'right', 'fill'=>'y') command proc{|*args| t.yview(*args)} t.yscrollcommand proc{|first,last| s.set first,last} @@ -92,32 +94,32 @@ txt = TkText.new($bind_demo){|t| } d1.bind('1', proc{ - eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`) + eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`, 'items.rb') }) d2.bind('1', proc{ - eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`) + eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`, 'plot.rb') }) d3.bind('1', proc{ - eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`) + eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`, 'ctext.rb') }) d4.bind('1', proc{ - eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`) + eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`, 'arrow.rb') }) d5.bind('1', proc{ - eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`) + eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`, 'ruler.rb') }) d6.bind('1', proc{ - eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`) + eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`, 'cscroll.rb') }) TkTextMarkInsert.new(t, '0.0') configure('state','disabled') } -txt.width 60 +txt.width 60 txt.height 24 |