[Tkinter-discuss] Recommendations on when to use pack vs. grid layouts?

Wayne Werner waynejwerner at gmail.com
Thu Dec 9 18:13:27 CET 2010

On Thu, Dec 9, 2010 at 10:33 AM, Michael Lange <klappnase at web.de> wrote:

> Thus spoketh python at bdurham.com
> unto us on Thu, 09 Dec 2010 10:52:39 -0500:
> > Are there any best practice tips regarding when one should use
> > pack vs. grid for their layouts?
> >
> > >From what I've been reading via google, the concencus seems to be
> > that grid can handle any pack scenario but not vice-versa.
> >
> At least it's hard to figure out something that pack can do and grid
> can't.
> Imho it's better to use grid, if you cannot setup your layout with
> pack without using extra frames. To tell the truth, I hardly ever use
> pack at all, as far as I can see, the only advantage of pack is that it
> takes 2 or 3 extra lines of code when you want to replace pack
> (fill='both', expand=1) with grid.

I agree.

I pretty much only use pack if I'm throwing something together really quick
and simple. If you have more than 3 or 4 widgets, it's probably better to
use grid, especially if you want some specific layout options.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20101209/f4ee7943/attachment.html>

More information about the Tkinter-discuss mailing list