From b67eef0f06be286de6ef3732e8f85801bf440dd0 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 30 Jul 2019 12:18:23 +0200 Subject: Checking for dirty bracket save on exit --- jfr_playoff/gui/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py index 086b3ab..56ed1cb 100644 --- a/jfr_playoff/gui/__init__.py +++ b/jfr_playoff/gui/__init__.py @@ -39,6 +39,7 @@ class PlayoffGUI(tk.Tk): self._dirty.trace('w', self._setMenuButtons) self._runTimer = None self._filepath = None + self.protocol('WM_DELETE_WINDOW', self.onClose) def run(self): self.notebook = ttk.Notebook(self) @@ -160,6 +161,10 @@ class PlayoffGUI(tk.Tk): filename = filename + '.jtpo' self.saveFile(filename) + def onClose(self, *args): + self._checkSave() + self.destroy() + def _run(self, config, interactive=True): self._interactive = interactive try: -- cgit v1.2.3