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

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

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (8)
    As of 2014-08-21 00:27 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (127 votes), past polls