Skip to content

Commit

Permalink
popups in threads so they don't lock up the ui thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Ixitxachitl committed Aug 21, 2023
1 parent 39e7c37 commit fedaace
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pywiki_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit fedaace

Please # to comment.