From ec8cecb5757850d2e1d03062bdca68fd95338677 Mon Sep 17 00:00:00 2001 From: Tom Schimansky Date: Mon, 25 Jul 2022 11:25:48 +0200 Subject: [PATCH] fixed window closing returning None of CTkInputDialog --- customtkinter/windows/ctk_input_dialog.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/customtkinter/windows/ctk_input_dialog.py b/customtkinter/windows/ctk_input_dialog.py index 0e3d198..d0c204f 100644 --- a/customtkinter/windows/ctk_input_dialog.py +++ b/customtkinter/windows/ctk_input_dialog.py @@ -42,6 +42,8 @@ class CTkInputDialog: self.top.focus_force() self.top.grab_set() + self.top.protocol("WM_DELETE_WINDOW", self.on_closing) + self.top.after(10, self.create_widgets) # create widgets with slight delay, to avoid white flickering of background def create_widgets(self): @@ -95,6 +97,9 @@ class CTkInputDialog: self.user_input = self.entry.get() self.running = False + def on_closing(self): + self.running = False + def cancel_event(self): self.running = False