Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Are there strong reasons for using certain geometry managers?

Yes there are, as far as I am concerned. Here are my guidelines.

  1. pack
  2. This is the simplest of the geomentry managers to use. I think of it as a concertina cardboard box with books stacked against each of the sides. Imagine the concertina contracts to minimise the space in the middle.

    Most of the time, you just stack against one side. However, the other options are useful if you want to add widgets in a different order.

  3. grid
  4. Pack is all very well for simple apps. And you can nest frames with widgets packing in different directions.

    But, the rows and columns will not line up. If the model of what you want to do fits better a matrix of cells, the grid geometry manager gives you this. Think Excel spreadsheet, or better, HTML table.

  5. place
  6. With the other two, positioning of widgets is automatic, and the size of the tol level window fits the size of what it contains.

    The place geometry manager, on the other hand, works like more traditional GUI programming languages, e.g. Visual Basic. Each widget is placed with coordinates of its origin and an exact size.

    place is used when the user has the ability to drag and move widgets around. However, in Tk, this type of activity tends to be done with a canvas.

There are other geometry managers, but these tend to be more specialised and less widely used.

I'm Not Just Another Perl Hacker

In reply to Re: Tk: pack, grid or place? by rinceWind
in thread Tk: pack, grid or place? by davies

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (4)
    As of 2018-05-20 17:49 GMT
    Find Nodes?
      Voting Booth?