[Tutor] How to make the label left justified in a frame

Michael Lange klappnase at freenet.de
Fri Nov 24 12:56:47 CET 2006


-- Forwarded to tutor list --

On Thu, 23 Nov 2006 16:25:41 +0000
"Asrarahmed Kadri" <ajkadri at googlemail.com> wrote:

> Sorry to bother you,
> But can u please explain what does grid_columnconfigure() do..
> 
> 

The best place for questions like this are usually the Tk man pages :)
Once you get used to them it is easy to figure out how to "translate" them into Python.

>From the grid manpage:

grid columnconfigure master index ?-option value...?
(...)
 The -weight option (an integer value) sets the relative weight for apportioning any extra spaces among
 columns. A weight of zero (0) indicates the column will not deviate from its requested size. A column whose
 weight is two will grow at twice the rate as a column of weight one when extra space is allocated to the
 layout.
(...)

So if you have a Frame f and do:

f.grid_columnconfigure(0, weight=0)
f.grid_columnconfigure(1, weight=2)
f.grid_columnconfigure(2, weight=1)

column 0 will not expand at all when the frame is stretched horizontally,
column 2 will expand and column 1 will expand even more.

I hope this helps

Michael


More information about the Tutor mailing list