fixed window closing returning None of CTkInputDialog

This commit is contained in:
Tom Schimansky 2022-07-25 11:25:48 +02:00
parent 156a1863f5
commit ec8cecb575

View File

@ -42,6 +42,8 @@ class CTkInputDialog:
self.top.focus_force() self.top.focus_force()
self.top.grab_set() 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 self.top.after(10, self.create_widgets) # create widgets with slight delay, to avoid white flickering of background
def create_widgets(self): def create_widgets(self):
@ -95,6 +97,9 @@ class CTkInputDialog:
self.user_input = self.entry.get() self.user_input = self.entry.get()
self.running = False self.running = False
def on_closing(self):
self.running = False
def cancel_event(self): def cancel_event(self):
self.running = False self.running = False