MountainDon't has asked for the wisdom of the Perl Monks concerning the following question:
Hi there! I am trying to set up some panes within frames within panes etc. just to test my knowledge of Tk panes and frames, and I have run into something I can't figure out.
I want an pane with a scrollbar on the bottom. In this pane, I want a blue bar (a frame with blue background) that's 40p tall and 500p wide that sticks to the top of pane. Underneath that blue bar, still in the first pane, I want another pane with a scrollbar on the right side. And in that pane, I want a green bar (frame with green background) that's 40p wide and 500p tall that sticks to the left of its parent frame.
I hope that's clear enough haha. Anyway, with what I've got below, all I'm seeing is the outer pane with the scrollbar at the bottom and the blue bar (which is not on the top of the pane :/ ) and no sign of the inside pane or green bar. Please shed some wisdom on me, where are my widgets?!
Also any other side notes on my code are gladly accepted!
use warnings; use Tk; use Tk::Pane; $mw = new MainWindow; $mw -> geometry("500x500"); $outerPane = $mw -> Scrolled("Pane", -scrollbars => 's') -> pack(-fill + => "both", -expand => 1); $blueBar = $outerPane -> Frame(-background => "light blue", -height => + 40, -width => 500) -> pack(); $innerPane = $outerPane -> Scrolled("Pane", -scrollbars => 'w') -> pac +k(-fill => "both", -expand => 1); $greenBar = $innerPane -> Frame(-background => "light green", -width = +> 40, -height => 500) -> pack(-fill => "y"); MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Tk Panes/Frames (probably simple)
by thundergnat (Deacon) on Sep 11, 2015 at 13:38 UTC | |
by MountainDon't (Initiate) on Sep 11, 2015 at 15:39 UTC | |
|
Re: Perl Tk Panes/Frames (sub Tk::Widget::Scrolled and sub Tk::Frame::AddScrollbars )
by Anonymous Monk on Sep 10, 2015 at 22:35 UTC | |
|
Re: Perl Tk Panes/Frames (probably simple)
by Anonymous Monk on Sep 11, 2015 at 15:56 UTC |