Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to close one of the windows in Tkinter
#1
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
Quote
#2
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.
Quote
#3
(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
Quote
#4
This is very helpful, thank you a lot.

what county am i in
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [Tkinter] How to close all windows when exit program scratchmyhead 3 244 May-17-2020, 08:19 AM
Last Post: menator01
  Tkinter scaling windows conten to or with its size not working Detzi 5 622 Jan-12-2020, 12:42 PM
Last Post: Detzi
  Using tkinter on Windows to launch python 3 scripts Mocap 1 469 Jul-17-2019, 05:16 AM
Last Post: Yoriz
  [Tkinter] Using tkinter and mutiprocess ok on windows, locks up on ubuntu? ice 3 703 May-29-2019, 08:44 AM
Last Post: ice
  Int Variables in different Tkinter windows only returning 0 harry76 3 1,115 May-26-2019, 10:24 AM
Last Post: Yoriz
  Program strange behavior ( windows doesn't close) adam2020 2 539 May-12-2019, 09:19 PM
Last Post: adam2020
  [Tkinter] Ignore windows scaling in tkinter Gangwick 2 1,510 Jul-23-2018, 02:41 PM
Last Post: Gangwick
  Using a class to create instances of Tkinter Toplevel() windows nortski 2 5,053 Mar-27-2018, 11:44 AM
Last Post: nortski
  Multi windows in tkinter buttons not responding correctly curtjohn86 13 5,089 Jul-01-2017, 03:42 PM
Last Post: nilamo
  [Tkinter] Tkinter GUI works on Windows but not on Ubuntu danbei 8 4,816 Jun-27-2017, 08:03 PM
Last Post: danbei

Forum Jump:


Users browsing this thread: 1 Guest(s)