Fix PySimpleGUI 5.x compatibility issue with theme() method
- Add try/except fallback for sg.theme() -> sg.set_options() - Resolves AttributeError when using PySimpleGUI 5.0.8.3 - Maintains backward compatibility with PySimpleGUI 4.x
This commit is contained in:
parent
49d90df3cb
commit
0aad0f80d2
1 changed files with 10 additions and 2 deletions
12
gui.py
12
gui.py
|
|
@ -19,7 +19,11 @@ class Dashboard:
|
|||
bot: Reference to the main bot instance
|
||||
"""
|
||||
self.bot = bot
|
||||
sg.theme('DarkBlue3')
|
||||
# PySimpleGUI 5.x compatibility
|
||||
try:
|
||||
sg.theme('DarkBlue3')
|
||||
except AttributeError:
|
||||
sg.set_options(theme='DarkBlue3')
|
||||
|
||||
# Event queue for thread-safe updates
|
||||
self.event_queue = Queue()
|
||||
|
|
@ -196,7 +200,11 @@ class SetupWizard:
|
|||
"""Configuration wizard for first-time setup"""
|
||||
|
||||
def __init__(self):
|
||||
sg.theme('DarkBlue3')
|
||||
# PySimpleGUI 5.x compatibility
|
||||
try:
|
||||
sg.theme('DarkBlue3')
|
||||
except AttributeError:
|
||||
sg.set_options(theme='DarkBlue3')
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue