Python Forum

Full Version: How to close one of the windows in Tkinter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys. I'm sure it's simple but what is the command to close a current window in Tkinter? I still want the root to be open but I want another window to close when I click a button. Thanks.

scratchmyhead
to remove, use windowname.destroy() - it's gone

or windowname.withdraw() - removed from screen, but not destroyed

windowname.iconify() - lowered and iconified (click to restore)

there is also lift and lower, which places a window on top of or behind another window, and if they are the same size, and at same location, can be used to cycle several windows.
(Nov-11-2019, 02:15 AM)Larz60+ Wrote: [ -> ]to remove, use windowname.destroy() - it's gone

or windowname.withdraw() - removed from screen, but not destroyed

windowname.iconify() - lowered and iconified (click to restore)

there is also lift and lower, which places a window on top of or behind another window, and if they are the same size, and at same location, can be used to cycle several windows.

Thanks. It helped me a lot.

what county am i in