Bottom Page

Thread Rating:
  • 4 Vote(s) - 2.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [Tkinter] Closing a window but not the whole program
#1
I want to close a window that I created by pressing a button. However if I put exit then it shuts the whole program down. Can anyone help me fix this?[size=medium][/size]
Quote
#2
Don't call sys.exit() then. I'm sure tk has a window close method. Maybe something like root.destroy() or frame.destroy().

If that doesn't help, please share some code so we can see what's going on.
Quote
#3
you might be able to use lift and lower, which will hide it behind another widget, but of course you need to have another widget large enough to hide behind.
The other method is withdraw, which I believe doesn't actually delete the window and it can be restored. I have used withdraw, but have never tried to redraw a withdrawn window, it could be as simple as issuing another geometry command (place, pack or grid).
Google it for details.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [PyQt] New window gunater 0 185 Mar-01-2019, 01:27 PM
Last Post: gunater
  [Tkinter] identify window DPaul 5 313 Feb-18-2019, 07:15 AM
Last Post: DPaul
  [PyQt] Window resizing help FesterJester 0 158 Feb-15-2019, 03:52 AM
Last Post: FesterJester
  [Tkinter] Tkinter window minimize,appear frequency 5 631 Dec-28-2018, 02:02 PM
Last Post: frequency
  [Tkinter] Tkinter window issue frequency 4 332 Dec-24-2018, 10:49 AM
Last Post: frequency
  Closing the Programm after stuck in while loop Rigunas 3 280 Dec-17-2018, 10:57 AM
Last Post: Rigunas
  [Kivy] Unable to get a window, abort. hajary8 0 565 Dec-13-2018, 06:17 PM
Last Post: hajary8
  top level window juliolop 3 542 Nov-07-2018, 02:52 PM
Last Post: juliolop
  Menu bar not showing in gui window mlh 2 615 Sep-09-2018, 10:27 PM
Last Post: mlh
  Plot on gui window macellan85 1 742 Jul-24-2018, 02:12 PM
Last Post: macellan85

Forum Jump:


Users browsing this thread: 1 Guest(s)