mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
Utils: support messagebox on windows without dependencies (#2224)
This commit is contained in:
5
Utils.py
5
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
|
||||
|
Reference in New Issue
Block a user