Linked Questions
33 questions linked to/from How do I handle the window close event in Tkinter?
32
votes
4
answers
67k
views
Overriding Tkinter "X" button control (the button that close the window) [duplicate]
When the user presses a close Button that I created, some tasks are performed before exiting. However, if the user clicks on the [X] button in the top-right of the window to close the window, I cannot ...
2
votes
2
answers
7k
views
Execute a certain command before closing window in tkinter [duplicate]
I am using tkinter with python.
Is it possible to execute a certain command (eg. print ("hello")) before closing the window, when close button is pressed?
I am using the close button of the desktop ...
0
votes
1
answer
3k
views
Python TKinter Event - Closing Window [duplicate]
What is the name of the event when the user clicks the X button at the upper right corner of the window? How will I override that function?
-1
votes
1
answer
1k
views
Save before closing python [duplicate]
I am building a GUI with Tkinter at the moment. With the GUI I can create files, add certain lines to the files, delete lines, save and load files. My problem is, that i want to prevent the closing of ...
0
votes
0
answers
38
views
How to handle X-ing out of a pop up in Tkinter [duplicate]
I am very new to using python and tkinter in general, but I was hoping to get some guidance on how to handle toplevel pop up exits. I have wrote a pop up that once would disable a button in the root ...
47
votes
2
answers
55k
views
Which tkinter modules were renamed in Python 3?
I am trying to create a file chooser dialog box. However, when I try to import tkMessageBox in Python 3, I get an error claiming that the module does not exist.
import tkMessageBox
# ImportError: No ...
7
votes
5
answers
29k
views
Intercept Tkinter "Exit" command?
I'm writing a client-server program in Python with Tkinter. I need the server to keep track of the connected clients. For this, I would like to have the client send an automated message to the ...
4
votes
2
answers
8k
views
Unclosable window using tkinter
Hey I am making a program that take a picture using my webcam when I type the wrong password. The program will be open and I want it unclosable.
I need to know how to make a window unclosable using ...
4
votes
1
answer
3k
views
How to detect X (close) button in python Turtle graphics?
When I click on the X (close) button while running a infinite loop of drawing in Turtle graphics, some error messages occurs.
Here is an example:
import turtle
wn = turtle.Screen()
tess = turtle....
0
votes
2
answers
7k
views
Stop execution of code python(Spyder/Ipython)
I'm coding a program (Python 3.6 on Spyder) that will analyse some reports. When the analysis is finished, i click on the exit button, but the code is still running on the console Ipython, how can i ...
0
votes
4
answers
3k
views
Tkinter-based app keeps running in the background if the window is closed abruptly
I've created a tkinter app designed to let users create and take quizzes locally. Unfortunately, if a user closes the window by hitting the 'x' in the corner instead of hitting the "quit" ...
0
votes
3
answers
2k
views
Prevent multiple toplevels from opening?
I have a object oriented tkinter program set up.
I have initialized a variable to store Toplevel() in as
self.toplevel = None
Then when I create the actual Toplevel window I simply assign it to the ...
0
votes
3
answers
2k
views
How to make python tkinter root close itself only?
I have a number of roots (frames) in my program. How do I set the command for the OS's exit button (the x at the top of the panel)? I want to make it so that I can close just one pane, not the entire ...
6
votes
1
answer
1k
views
Python thread calling won't finish when closing tkinter application
I am making a timer using tkinter in python. The widget simply has a single button. This button doubles as the element displaying the time remaining. The timer has a thread that simply updates what ...
2
votes
2
answers
1k
views
How to force user to select at least one check button
I have a program I am working on and want the user to select their interests, and when they are done press submit. How would I only allow the user to press submit if at least one button is checked.
...