Howdy!

Whenever you ->pack a widget (and frames are just another widget that you happen to be able to put things into), the space gets divided into two pieces. One gets the widget and the other remains available for the next pack operation.

If you pack(-side => 'top') or pack(-side => 'bottom'), the container is split by a horizontal line and you take whichever part you claim. 'left' and 'right' split with a vertical line.

ASCII illustration follows:

+----------------------+   +-----------+----------+
| pack(-side => 'top') |   |           |          |
|                      |   |  left     |   right  |
+----------------------+   |           |          |
|                      |   |           |          |
|   bottom             |   |           |          |
+----------------------+   +-----------+----------+

Note that each pack further splits the space in two. You can not use pack to do:

+----+---------+
|    |         |
|    +----+----+
|    |    |    |
+----+----+    |
|         |    |
+---------+----+

If you need to do something like that, you have to use a different mechanism, and I don't know that well enough to speak off the top of my head.

Another way to look at it is:

You start with a rectangular space. You use pack to grab a rectangular chunk that touches three sides but not the fourth, into which you pack your widget. The remaining rectangular space is where the next pack goes. If the widget you pack is a container like a Frame, you have a new space to start with.

"It's rectangles all the way down..."

yours,
Michael


In reply to Re: Arranging Frames in TK by herveus
in thread Arranging Frames in TK by Lhamo_rin

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.