Overriding Tkinter "X" button control (the button that close the window)

Viewed 57460

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 perform these tasks.

How can I override what happens when the user clicks [X] button?

4 Answers
Related