Figured it out: Tkinter grid and why 'sticky' option seems iffy

Gabe Newcomb Gabe.Newcomb at noetix.com
Fri Jul 26 14:03:59 EDT 2002


I was having problems where the sticky option in grid() didn't seem to
move widgets out of the middle of the cell they were in. Turns out the
reason was Tkinter default behavior is to determine column/row width
based on the size of the widget that is contained, NOT based on the
width of the master divided by the number of rows/columns.

This seemed wierd to me, e.g., why, if I had a single cell in one frame
(one row and one column only), should that cell not fill the entire
frame? Anyways, the answer for me seems to always be to set the weight
of the columns/rows to 1 (assuming I want equal widths).

I'm posting this in the hopes that it helps out other newbies.

Thanks,

Gabe Newcomb
Software Test Automation Engineer
425.372.2732
Noetix Corporation
www.noetix.com

after years of waiting, nothing came






More information about the Python-list mailing list