From fedaace027f62df3c9c52cf4e66ac57af5d520ee Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 21 Aug 2023 09:58:21 -0700 Subject: [PATCH] popups in threads so they don't lock up the ui thread --- src/pywiki_lite.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pywiki_lite.py b/src/pywiki_lite.py index 18426e7..2429508 100644 --- a/src/pywiki_lite.py +++ b/src/pywiki_lite.py @@ -44,7 +44,7 @@ def resource_path(relative_path): def get_version(): - return "1.60" # Version Number + return "1.61" # Version Number class TwitchBotGUI(tk.Tk): @@ -107,7 +107,8 @@ def on_selection_change(self, event): def show_about_popup(self): about_text = "pyWiki Lite " + get_version() + "\n©2023 Ixitxachitl\nAnd ChatGPT" - messagebox.showinfo("About", about_text) + thread = threading.Thread(target=lambda: messagebox.showinfo("About", about_text)) + thread.start() def append_to_log(self, message): self.log_queue.put(message) @@ -313,8 +314,10 @@ def show_popup(self, event): except ValueError: time_string = '' - messagebox.showinfo(selected_item, 'Created on: ' + created_at + '\nFollowed on: ' + followed_at + - '\n' + time_string) + thread = threading.Thread(target=lambda: messagebox.showinfo(selected_item, 'Created on: ' + created_at + + '\nFollowed on: ' + followed_at + '\n' + + time_string)) + thread.start() except KeyError: messagebox.showerror("Error", "Error parsing response data") except IndexError: