Applicatiosn/OS/ShutDown.app: Update MessageBox API

This commit is contained in:
Alec Murphy 2025-03-28 19:07:39 -04:00
parent bfa41f334b
commit b7952b1cb8

View file

@ -2,24 +2,18 @@ Gui.App();
U0 @shutdown_callback(U64 o)
{
if (!o)
return;
Window* win = NULL;
if (o(Window*)->signature == WIN_SIGNATURE) {
Compositor.DestroyWindow(o(Window*));
Gui.Window.SetFocus(Compositor.GetWindowByTitle("Wallpaper"));
return;
}
switch (o(Widget*)->tag) {
case TRUE:
System.PowerOff();
break;
default:
Compositor.DestroyWindow(o(Widget*)->parent_win);
Gui.Window.SetFocus(Compositor.GetWindowByTitle("Wallpaper"));
return;
break;
win = o;
} else {
if (o(Widget*)->tag) {
System.PowerOff();
} else {
win = o(Widget*)->parent_win;
}
}
Compositor.DestroyWindow(win);
Gui.Window.SetFocus(Compositor.GetWindowByTitle("Wallpaper"));
}
MessageBox.Alert("Do you want to shut down this computer?",
"[\"OK\",\"Cancel\"]", &@shutdown_callback);
MessageBox.Confirm("Do you want to shut down this computer?", &@shutdown_callback);