From 0d8a868ed972d610fbbbad7fd014a80352951e00 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 8 Oct 2023 22:14:28 +0200 Subject: [PATCH] Utils: support messagebox on windows without dependencies (#2224) --- Utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utils.py b/Utils.py index d48b8ea9..5fb037a1 100644 --- a/Utils.py +++ b/Utils.py @@ -680,6 +680,11 @@ def messagebox(title: str, text: str, error: bool = False) -> None: if zenity: return run(zenity, f"--title={title}", f"--text={text}", "--error" if error else "--info") + elif is_windows: + import ctypes + style = 0x10 if error else 0x0 + return ctypes.windll.user32.MessageBoxW(0, text, title, style) + # fall back to tk try: import tkinter