[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: tkinter question
From:       Kevin Walzer <kw () codebykevin ! com>
Date:       2007-10-05 13:17:24
Message-ID: 47063964.7000809 () codebykevin ! com
[Download RAW message or body]

Eric Brunel wrote:
> On Fri, 05 Oct 2007 14:10:57 +0200, Kevin Walzer <kw@codebykevin.com> 
> wrote:
>> "expand = 1" ==  "expand=TRUE"--that means the widget resizes itself 
>> when the window is re-sized.
> 
> That's the theory... But what does fill=BOTH means then? And why does 
> expand=1 (or TRUE, or True) is only needed in some cases and not others? 
> And I'm quite sure that sometimes, I use expand=1 and it does exactly 
> what I don't want, and removing it gives the behaviour I want. I've been 
> doing tk/Tkinter stuff for quite a few years now, and I still haven't 
> understood exactly when I should use this option... Quite 
> counter-intuitive, IMHO.
> 
> But then, since I almost never use pack for this kind of layout, I guess 
> it's not really important...

"Fill" refers to the dimension/space that is filled when you expand the 
widget (assuming "expand" is set to true). "fill=x" means the widget 
will expand horizontally (along the x axis). "fill=y" means that the 
widget will expand vertically (along the y axis). "fill=both" means the 
widget will expand in both direction.

Frederick Lundh has a good introduction to the packer here: 
http://effbot.org/tkinterbook/pack.htm

I find "pack" to be more flexible than "grid," so I prefer it for 
complex layouts. "grid" is better for simple layouts.

HTH,
Kevin

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic