From 61a68941b1d22973dfb832e0575596d53f3e31b4 Mon Sep 17 00:00:00 2001 From: knu Date: Fri, 23 May 2008 05:22:13 +0000 Subject: Merge from ruby_1_8. Add files that have not been added yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/sample/demos-en/pendulum.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/tk/sample/demos-en/pendulum.rb') diff --git a/ext/tk/sample/demos-en/pendulum.rb b/ext/tk/sample/demos-en/pendulum.rb index a3498d67cf..5f7d361170 100644 --- a/ext/tk/sample/demos-en/pendulum.rb +++ b/ext/tk/sample/demos-en/pendulum.rb @@ -18,8 +18,10 @@ $pendulum_demo = TkToplevel.new {|w| positionWindow(w) } +base_frame = TkFrame.new($pendulum_demo).pack(:fill=>:both, :expand=>true) + # create label -msg = TkLabel.new($pendulum_demo) { +msg = TkLabel.new(base_frame) { font $font wraplength '4i' justify 'left' @@ -28,7 +30,7 @@ msg = TkLabel.new($pendulum_demo) { msg.pack('side'=>'top') # create frame -TkFrame.new($pendulum_demo) {|frame| +TkFrame.new(base_frame) {|frame| TkButton.new(frame) { text 'Dismiss' command proc{ @@ -49,7 +51,7 @@ TkFrame.new($pendulum_demo) {|frame| class PendulumAnimationDemo def initialize(frame) # Create some structural widgets - @pane = TkPanedWindow.new(frame).pack(:fill=>:both, :expand=>true) + @pane = TkPanedWindow.new(frame, :orient=>:horizontal).pack(:fill=>:both, :expand=>true) # @pane.add(@lf1 = TkLabelFrame.new(@pane, :text=>'Pendulum Simulation')) # @pane.add(@lf2 = TkLabelFrame.new(@pane, :text=>'Phase Space')) @lf1 = TkLabelFrame.new(@pane, :text=>'Pendulum Simulation') @@ -235,4 +237,4 @@ class PendulumAnimationDemo end # Start the animation processing -PendulumAnimationDemo.new($pendulum_demo) +PendulumAnimationDemo.new(base_frame) -- cgit v1.2.3