1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibGUI: Add input types to GMessageBox.

Currently the two available input types are:

- GMessageBox::InputType::OK (default)
- GMessageBox::InputType::OKCancel

Based on your choice, GMessageBox::exec() will return ExecOK or ExecCancel.
This commit is contained in:
Andreas Kling 2019-07-16 21:32:10 +02:00
parent 62335c5f0c
commit a17fbd98e7
8 changed files with 63 additions and 26 deletions

View file

@ -50,7 +50,7 @@ int main(int argc, char** argv)
auto filename = picker.selected_file().string();
auto bitmap = load_png(filename);
if (!bitmap) {
GMessageBox msgbox(String::format("Failed to load '%s'", filename.characters()), "Open failed", GMessageBox::Type::Error, window);
GMessageBox msgbox(String::format("Failed to load '%s'", filename.characters()), "Open failed", GMessageBox::Type::Error, GMessageBox::InputType::OK, window);
msgbox.exec();
return;
}