Tkinter, grid, in_: widget definition order significant ?!

Sorin Schwimmer sxn02 at yahoo.com
Tue Jul 4 12:08:45 EDT 2006


Hi,

Working on my current project, I discovered the following behaviour: a widget defined before the window in which I try to grid it won't show up, but will take space and behave like it is there (blind typing proves it). A widget defined after the griding window will come up fine. The following example illustrates my point:

<code>
from Tkinter import *

r=Tk()
l1=Label(r, text='first label')
f=Frame(r)
f.grid()
l1.grid(in_=f, row=0)
l2=Label(r, text='second label')
l2.grid(in_=f, row=1)
</code>

On my system (Gentoo Linux, Python 2.4.1) l1 (defined before f) takes spaces, but is invisible, while l2 (defined after f) is OK.

That's the way it is intended to be? How would I grid stuff in dynamically created windows?

Thanks for your advice,
Sorin Schwimmer

 		
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060704/b501bdd7/attachment.html>


More information about the Python-list mailing list