fishyboteso/fishy/gui/funcs.py
DESKTOP-JVKHS7I\Adam 3e96fbed2c 0.3.3 reworked notifications again (now uses discord chat)
- fixed ui scaling issues
- now uses callables for thread comunication instead of enums (removed comms.py altogether)
- added options to run using test server
2020-05-19 10:56:50 +05:30

24 lines
667 B
Python

from tkinter import messagebox, NORMAL
# noinspection PyProtectedMember
class GUIFuncs:
def __init__(self, gui):
self.gui = gui
def set_notify(self, flag):
def func():
self.gui._notify_check['state'] = NORMAL
self.gui._notify.set(flag)
self.gui.call_in_thread(func)
def show_error(self, error):
self.gui.call_in_thread(lambda: messagebox.showerror("ERROR", error))
def bot_started(self, started):
def func():
self.gui._bot_running = started
self.gui._start_button["text"] = "STOP" if self.gui._bot_running else "START"
self.gui.call_in_thread(func)