aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/demos-jp/paned1.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-02 09:58:13 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-02 09:58:13 +0000
commit6277a66deb30559a8ea991175c274e0fd899e48e (patch)
tree0f1f15f96c362749e2646ae14a23e9d4a0a5e3e4 /ext/tk/sample/demos-jp/paned1.rb
parent08719ea2380b179ef98a10cd5e871be7a44fff43 (diff)
downloadruby-6277a66deb30559a8ea991175c274e0fd899e48e.tar.gz
* (bug fix) forgot to entry a widget class name of 'labelframe' widget
* add demo-scripts to the JP/EN widget demos git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/demos-jp/paned1.rb')
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/ext/tk/sample/demos-jp/paned1.rb b/ext/tk/sample/demos-jp/paned1.rb
new file mode 100644
index 0000000000..99e6b6cddb
--- /dev/null
+++ b/ext/tk/sample/demos-jp/paned1.rb
@@ -0,0 +1,48 @@
+# paned1.rb
+#
+# This demonstration script creates a toplevel window containing
+# a paned window that separates two windows horizontally.
+#
+# based on "Id: paned1.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp"
+
+if defined?($paned1_demo) && $paned1_demo
+ $paned1_demo.destroy
+ $paned1_demo = nil
+end
+
+$paned1_demo = TkToplevel.new {|w|
+ title("Horizontal Paned Window Demonstration")
+ iconname("paned1")
+ positionWindow(w)
+}
+
+TkLabel.new($paned1_demo,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+下の色付けされた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。
+もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない
+場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような
+より新しいバージョンの Tk を組み合わせて試す
+ようにしてください。
+EOL
+
+# The bottom buttons
+TkFrame.new($paned1_demo){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'了解', :width=>15, :command=>proc{
+ $paned1_demo.destroy
+ $paned1_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'paned1'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+TkPanedwindow.new($paned1_demo){|f|
+ pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m')
+
+ add(TkLabel.new(f, :text=>"This is the\nleft side", :bg=>'yellow'),
+ TkLabel.new(f, :text=>"This is the\nright side", :bg=>'cyan'))
+}