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 | bbe91bcd1898d544739e41fdf91aa8288526540a (patch) | |
tree | d280d8542cc44d1cd1a75e8ec87b1f9d231561b7 /ext/tk/sample/demos-jp/paned2.rb | |
parent | 28c7b64f14c02a953ba051acd144e4ee5144450e (diff) | |
download | ruby-bbe91bcd1898d544739e41fdf91aa8288526540a.tar.gz ruby-bbe91bcd1898d544739e41fdf91aa8288526540a.tar.xz ruby-bbe91bcd1898d544739e41fdf91aa8288526540a.zip |
* ext/tk/lib/tk/*: untabify
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/demos-jp/paned2.rb')
-rw-r--r-- | ext/tk/sample/demos-jp/paned2.rb | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/ext/tk/sample/demos-jp/paned2.rb b/ext/tk/sample/demos-jp/paned2.rb index c6b0f0691..1e82eddda 100644 --- a/ext/tk/sample/demos-jp/paned2.rb +++ b/ext/tk/sample/demos-jp/paned2.rb @@ -17,8 +17,8 @@ $paned2_demo = TkToplevel.new {|w| } TkLabel.new($paned2_demo, - :font=>$font, :wraplength=>'4i', :justify=>:left, - :text=><<EOL).pack(:side=>:top) + :font=>$font, :wraplength=>'4i', :justify=>:left, + :text=><<EOL).pack(:side=>:top) 下のスクロールバー付きのウィジェットが置かれた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。 もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない 場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような @@ -31,13 +31,13 @@ TkFrame.new($paned2_demo){|f| pack(:side=>:bottom, :fill=>:x, :pady=>'2m') TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{ - $paned2_demo.destroy - $paned2_demo = nil - }).pack(:side=>:left, :expand=>true) + $paned2_demo.destroy + $paned2_demo = nil + }).pack(:side=>:left, :expand=>true) TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{ - showCode 'paned2' - }).pack(:side=>:left, :expand=>true) + showCode 'paned2' + }).pack(:side=>:left, :expand=>true) } paneList = TkVariable.new # define as normal variable (not array) @@ -68,29 +68,29 @@ TkPanedwindow.new($paned2_demo, :orient=>:vertical){|f| pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m') add(TkFrame.new(f){|paned2_top| - TkListbox.new(paned2_top, :listvariable=>paneList) { - # Invert the first item to highlight it - itemconfigure(0, :background=>self.cget(:foreground), - :foreground=>self.cget(:background) ) - yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, - :fill=>:y)) - pack(:fill=>:both, :expand=>true) - } + TkListbox.new(paned2_top, :listvariable=>paneList) { + # Invert the first item to highlight it + itemconfigure(0, :background=>self.cget(:foreground), + :foreground=>self.cget(:background) ) + yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right, + :fill=>:y)) + pack(:fill=>:both, :expand=>true) + } }, TkFrame.new(f, :height=>120) {|paned2_bottom| - # The bottom window is a text widget with scrollbar - paned2_xscr = TkScrollbar.new(paned2_bottom) - paned2_yscr = TkScrollbar.new(paned2_bottom) - paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { - insert('1.0', 'ここに配置されているのは、' + - 'ごく普通のテキストウィジェットです。') - xscrollbar(paned2_xscr) - yscrollbar(paned2_yscr) - } - Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew') - Tk.grid(paned2_xscr, :sticky=>'nsew') - TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1) - TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1) + # The bottom window is a text widget with scrollbar + paned2_xscr = TkScrollbar.new(paned2_bottom) + paned2_yscr = TkScrollbar.new(paned2_bottom) + paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) { + insert('1.0', 'ここに配置されているのは、' + + 'ごく普通のテキストウィジェットです。') + xscrollbar(paned2_xscr) + yscrollbar(paned2_yscr) + } + Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew') + Tk.grid(paned2_xscr, :sticky=>'nsew') + TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1) + TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1) } ) } |