diff options
Diffstat (limited to 'ext/tk/sample/demos-jp/radio2.rb')
-rw-r--r-- | ext/tk/sample/demos-jp/radio2.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb index b89520cdc5..cf53e3e485 100644 --- a/ext/tk/sample/demos-jp/radio2.rb +++ b/ext/tk/sample/demos-jp/radio2.rb @@ -21,8 +21,10 @@ $radio2_demo = TkToplevel.new {|w| positionWindow(w) } +base_frame = TkFrame.new($radio2_demo).pack(:fill=>:both, :expand=>true) + # label -msg = TkLabel.new($radio2_demo) { +msg = TkLabel.new(base_frame) { font $font wraplength '5i' justify 'left' @@ -36,7 +38,7 @@ color = TkVariable.new align = TkVariable.new # frame -TkFrame.new($radio2_demo) {|frame| +TkFrame.new(base_frame) {|frame| TkButton.new(frame) { #text '了解' text '閉じる' @@ -56,18 +58,18 @@ TkFrame.new($radio2_demo) {|frame| TkButton.new(frame) { text '変数参照' command proc{ - showVars($radio2_demo, + showVars(base_frame, ['size', size], ['color', color], ['compound', align]) } }.pack('side'=>'left', 'expand'=>'yes') }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m') # frame -f_left = TkLabelFrame.new($radio2_demo, 'text'=>'文字サイズ', +f_left = TkLabelFrame.new(base_frame, 'text'=>'文字サイズ', 'pady'=>2, 'padx'=>2) -f_mid = TkLabelFrame.new($radio2_demo, 'text'=>'色', +f_mid = TkLabelFrame.new(base_frame, 'text'=>'色', 'pady'=>2, 'padx'=>2) -f_right = TkLabelFrame.new($radio2_demo, 'text'=>'ビットマップ配置', +f_right = TkLabelFrame.new(base_frame, 'text'=>'ビットマップ配置', 'pady'=>2, 'padx'=>2) f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') @@ -93,7 +95,8 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c') }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x') } -label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', +# label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', +label = Tk::Label.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead', 'compound'=>'left') label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top') label.height(TkWinfo.reqheight(label)) |