How to clear all content in a Tk()

E

eneskristo

I have this program, and since I want to change stuff dynamically, I want to fully clear the root = Tk(), without deleting it. Is there a way to do so?
 
M

Marcel Rodrigues

What about this:

Put a Frame() inside the root: `frame = Frame(root)`. This frame will be
the only immediate child of root. Everything else will be put inside the
frame. When you need to clear the root, call `frame.destroy()`. This will
destroy `frame` and all its children. You will need to recreate the frame,
but not the root.
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top