diff options
Diffstat (limited to 'ext/tk/sample/demos-en/pendulum.rb')
-rw-r--r-- | ext/tk/sample/demos-en/pendulum.rb | 10 |
1 files changed, 6 insertions, 4 deletions
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) |