-1

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 the window if the current file wasn't saved. Is there a way to solve this problem?

0

1 Answer 1

1

Yes. That is totally possible (unless perhaps the process is being terminated abruptly), by making use of WM_DELETE_WINDOW protocol:

...The most commonly used protocol is called WM_DELETE_WINDOW, and is used to define what happens when the user explicitly closes a window using the window manager.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.