Re: tackling the packer



Gerald W. Lester wrote:

> While someone else has answered your question -- you may want to consider
> using the grid geometry manager instead of the packer. I suspect you will
> find it easier to use.

"Easier" depending on purpose. Using [grid], it's easier to layout
widgets in, well, a grid. Unfortunately, you have to keep track of
column and row numbers.

Having started with [pack], I find the fact that you need to
columnconfigure and rowconfigure grid weights in order to get -expand
functionality, rather than giving both options as one would with -expand
and -fill to [pack]. That said, the ability to set proportional
expansion with weight is a major plus for [grid].

It's all a matter of preference. Like laying things out in a table?
Enjoy [grid]. Like not having to count rows and columns all day? Use
[pack]. Enjoy counting pixels? [place] is for you. :-)

Just don't try mixing them at the same level. You can pack things
inside of a [grid]ed frame, I had a horrible problem when I accidentally
[pack]ed .frame0 and used [grid] on .frame1 ... the window never
completed drawing to screen, and pegged the processor load.

--
MKS
.



Relevant Pages

  • Re: usage of checkbutton
    ... grid configure $frame.l1-$FN -sticky e ... I had to use grid and pack as I do not use grid nothing shows on the ... when I took your code and ran it I saw a bunch of radiobuttons. ... You can use an existing row and column if it's something that would benefit from growing or shrinking (for example, a text widget, canvas, or an entry widget), or you can use an invisible row or column. ...
    (comp.lang.tcl)
  • Re: mixing pack and grid Geometry Managers
    ... > of our engineer started using grid. ... Due this mix of pack and grid, ... Both work equally well, IMO, but solve slightly different layout problems. ... you also have to do rowconfigure and/or columnconfigure commands to get ...
    (comp.lang.tcl)
  • Re: How to create appropriate Ok/Cancel buttons in the bottom of a dialog?
    ... I know this might be a simple thing to do, but Tk's grid and pack are ... but you can pack widgets into a frame then grid that frame into some ... other widget and visa versa. ...
    (comp.lang.tcl)
  • Re: A few Tk related queries
    ... Bruce Hartweg wrote: ... but my questions is when i pack a menubutton on it ... >> I would like to know more about the grid geomtery manager. ... > it can simplify a great many things for layouts, ...
    (comp.lang.tcl)
  • Re: changing looks in a main window
    ... :>>the full power of pack() may not be immediately apparent. ... :>is more powerful than grid. ... BrowseEntry Button ... where I did use frames I packed their ...
    (comp.lang.perl.tk)