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();

In reply to Perl Tk Panes/Frames (probably simple) by MountainDon't

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.