How to clear all content in a Tk()

Marcel Rodrigues marcelgmr at gmail.com
Tue Mar 25 18:03:24 CET 2014


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.


2014-03-24 17:30 GMT-03:00 <eneskristo at gmail.com>:

> 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?
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140325/0652cabb/attachment.html>


More information about the Python-list mailing list