From 0aad0f80d2f7ea852a7e79b6dba0f88676e6a65c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 2 Jan 2026 20:29:52 +0000 Subject: [PATCH] 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 --- gui.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 498fa2a..3967192 100644 --- a/gui.py +++ b/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): """