From bd545f866f72d4cb43f214a9aeedae76c8aa3d5c Mon Sep 17 00:00:00 2001 From: Karl Lehenbauer Date: Tue, 30 May 2023 12:45:54 -0500 Subject: [PATCH] close program on main window deletion --- UnMixer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UnMixer.py b/UnMixer.py index a824379..5f5ae85 100644 --- a/UnMixer.py +++ b/UnMixer.py @@ -1,12 +1,19 @@ import os +import sys import tkinter as tk import unmix create_console = True +def on_close(): + sys.exit(0) + root = tk.Tk() +root.protocol("WM_DELETE_WINDOW", on_close) + root.my_gui = unmix.UnmixGUI(root) + if create_console: unmix.create_console(tk, root.my_gui) print("yo baby yo baby yo")