Skip to content

Commit

Permalink
Only apply modal style on macOS
Browse files Browse the repository at this point in the history
Attempting to apply the style on Linux will fail with a TclError.

For #13
  • Loading branch information
peterstory committed May 24, 2024
1 parent 44e7b37 commit 76f7bcc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/pydiode/gui/receive.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ def show_window(cls, root, target_dir):
cls.top.bind("<Return>", 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
Expand Down

0 comments on commit 76f7bcc

Please sign in to comment.