Tkinter question: disappearing label using the packer?
Jake Baker
jbaker at ummelec.com
Tue Apr 24 11:29:26 EDT 2001
Hi all. Thanks for answering my last question! Here's another one:
I'm using Tkinter (under windows NT, if that's relevant.) I want to carefully place some items on the window, so I decided to use the packer(). Since I want to mix styles in the same window, I want to put my place()d objects in a Frame object. Surprise! When I do this, the objects in the Frame disappear! (Actually, the frame disappears to!)
Examples:
This works: (using the pack()er)
=begin=
from Tkinter import *
root = Tk()
label = Label(root, text='Hello world!')
label.pack()
root.mainloop()
= end =
This does not work: (place()ing in a nested Frame object)
=begin=
from Tkinter import *
root = Tk()
frame = Frame(root, bg='white')
frame.pack()
label = Label(frame, text='Hello world!')
label.place(x=0)
root.mainloop()
=end=
Can any tk guru tell me why this is happening? I'm so frustrated trying to get Tk to display the way I want it to I'm thinking of creating all my own widgets and gui routines and painting them on a Canvas!
Thanks,
- Jake
More information about the Python-list
mailing list