summaryrefslogtreecommitdiff
path: root/ext/tk/sample/demos-jp/goldberg.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/sample/demos-jp/goldberg.rb')
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/ext/tk/sample/demos-jp/goldberg.rb b/ext/tk/sample/demos-jp/goldberg.rb
index 8bf0104c16..a81c7ec70c 100644
--- a/ext/tk/sample/demos-jp/goldberg.rb
+++ b/ext/tk/sample/demos-jp/goldberg.rb
@@ -55,6 +55,8 @@ $goldberg_demo = TkToplevel.new {|w|
# positionWindow(w)
}
+base_frame = TkFrame.new($goldberg_demo).pack(:fill=>:both, :expand=>true)
+
=begin
# label
msg = TkLabel.new($goldberg_demo) {
@@ -177,7 +179,8 @@ class TkGoldberg_Demo
do_ctrl_frame
do_detail_frame
- msg = TkLabel.new(@parent, :bg=>@C['bg'], :fg=>'white') {
+ # msg = TkLabel.new(@parent, :bg=>@C['bg'], :fg=>'white') {
+ msg = Tk::Label.new(@parent, :bg=>@C['bg'], :fg=>'white') {
font 'Arial 10'
wraplength 600
justify 'left'
@@ -187,7 +190,8 @@ class TkGoldberg_Demo
frame = TkFrame.new(@parent, :bg=>@C['bg'])
- TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
text '閉じる'
command proc{
tmppath = $goldberg_demo
@@ -196,12 +200,14 @@ class TkGoldberg_Demo
}
}.pack('side'=>'left')
- TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
text 'コード参照'
command proc{showCode 'goldberg'}
}.pack('side'=>'left', 'padx'=>5)
- @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl},
+ # @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl},
+ @show = Tk::Button.new(frame, :text=>'>>', :command=>proc{show_ctrl},
:bg=>@C['bg'], :activebackground=>@C['bg'])
@show.pack('side'=>'left')
frame.place(:in=>@canvas, :relx=>1, :rely=>0, :anchor=>:ne)
@@ -210,10 +216,11 @@ class TkGoldberg_Demo
end
def do_ctrl_frame
- @start = TkButton.new(@parent, :text=>'Start', :bd=>6,
+ @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6,
:command=>proc{do_button(0)})
- @start.font(@start['font'].weight('bold'))
- font = @start['font']
+ if font = @start['font']
+ @start.font(font.weight('bold'))
+ end
@pause = TkCheckbutton.new(@parent, :text=>'Pause', :font=>font,
:command=>proc{do_button(1)}, :relief=>:raised,
@@ -2001,4 +2008,4 @@ class TkGoldberg_Demo
end
end
-TkGoldberg_Demo.new($goldberg_demo)
+TkGoldberg_Demo.new(base_frame)