From 76f7bcc0ecfc43ba31273b8fa1ef73f8ff941c6d Mon Sep 17 00:00:00 2001 From: Peter Story Date: Fri, 24 May 2024 09:50:11 -0400 Subject: [PATCH] Only apply modal style on macOS Attempting to apply the style on Linux will fail with a TclError. For #13 --- src/pydiode/gui/receive.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pydiode/gui/receive.py b/src/pydiode/gui/receive.py index 3cf3cf0..bb16aa8 100644 --- a/src/pydiode/gui/receive.py +++ b/src/pydiode/gui/receive.py @@ -127,12 +127,13 @@ def show_window(cls, root, target_dir): cls.top.bind("", cls.on_ok) # Use modal style on macOS - cls.top.tk.call( - "::tk::unsupported::MacWindowStyle", - "style", - cls.top._w, - "modal", - ) + if sys.platform == "darwin": + cls.top.tk.call( + "::tk::unsupported::MacWindowStyle", + "style", + cls.top._w, + "modal", + ) # Center the modal over the main window width = 400