[Tkinter-discuss] moving from pack to grid

Tony Cappellini cappy2112 at gmail.com
Mon Nov 27 04:30:51 CET 2006

I've got a main window which is 640 * 400.

 self.label.pack(side=BOTTOM, fill=X)
This line would put the label at the bottom of the window, and extend to
both left and right edges of the window.

I want to change to grid geometry because I have several more widgets to put
in the main window.
self.label.grid(row=5, column=2, column=0)

This put the label at row 5, in the center of the window, but the label
didn't extend to the window edges.

After reading this http://effbot.org/tkinterbook/grid.htm

I tried playing around with other options, but can't get the label to move
any lower in the main window

self.label.grid(row=10, column=2, column=0)  didn't move the label any lower
than row 5

My main window isn't constructed using pack(), so I'm not mixing grid and
pack in this program.
Although, the main window isn't calling grid explicitly either- that's a bit
confusing, because I thought all widgets had to call grid or pack to be

What args do I need to move the label to the bottom of the window, and
centered so it extends to both left and right edges?
I don't like to hard-code a row number, I'd rather make it dynamic in case
the window grows or shrinks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20061126/1bd6d6cc/attachment.htm 

More information about the Tkinter-discuss mailing list