Reputation: 47
Currently I am working on a project related to database handling issues.
I am assigning display functions on the Button present in the Menubar. How can I erase the whole thing displayed on the screen after having my work done.
For eg,
After the user completes his work, if he wants to do some other task, then how can I program of erasing the entire screen and then displaying the user command?
Note The entire script was programmed in Python with the help of Tkinter GUI Module.
Upvotes: 1
Views: 75
Reputation: 36
for widget in rootWidget.winfo_children():
widget.destroy()
winfo_children()
returns a list of all widgets which are children of the root Widget, so with the for loop you just pass through all the widgets in your window and destroy them. If you want you can destroy just some of the children (for example last 5) just by indexing them.
Upvotes: 2