Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

frames in toplevel Tkinter

2 views
Skip to first unread message

J Wolfe

unread,
Dec 16, 2009, 6:09:32 PM12/16/09
to
Probably a stupid question, but can you have a frames in a toplevel
widget? Anything I try to put in a frame goes back to the main or root
widget and not the toplevel or pop-up widget.

Thanks for the help!
Jonathan

J Wolfe

unread,
Dec 17, 2009, 11:26:44 AM12/17/09
to

Thank you John,

from Tkinter import *
root = Tk()
Label(root, text='This is the root window').pack()
top = Toplevel(root)
fr = Frame(top) # frame child of Toplevel called top
fr.pack()
Label(fr, text='This is in a frame in the Toplevel window').pack()
root.mainloop()

I swear I tried that about 20 times yesterday...and it kept putting it
in my main window. Perhaps I had a naming issue.

Thanks!
Jonathan

0 new messages