frames in toplevel Tkinter

J

J Wolfe

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

J Wolfe

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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top