mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21: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:
|
if zenity:
|
||||||
return run(zenity, f"--title={title}", f"--text={text}", "--error" if error else "--info")
|
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
|
# fall back to tk
|
||||||
try:
|
try:
|
||||||
import tkinter
|
import tkinter
|
||||||
|
Reference in New Issue
Block a user