diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-19 00:01:02 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-19 00:01:02 +0100 |
commit | 57ff293a51d97742d50987950c86dfcde55e6ad1 (patch) | |
tree | 44cb31375a62808be2b743758bc6c42c574b4afa /LibGUI/GMessageBox.h | |
parent | 55aa8190773721f1dc0a3f49bedea6ed8524b318 (diff) | |
download | serenity-57ff293a51d97742d50987950c86dfcde55e6ad1.zip |
LibGUI: Implement nested event loops to support dialog boxes.
This patch adds a simple GMessageBox that can run in a nested event loop.
Here's how you use it:
GMessageBox box("Message text here", "Message window title");
int result = box.exec();
The next step is to make the WindowServer respect the modality flag of
these windows and prevent interaction with other windows in the same
process until the modal window has been closed.
Diffstat (limited to 'LibGUI/GMessageBox.h')
-rw-r--r-- | LibGUI/GMessageBox.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/LibGUI/GMessageBox.h b/LibGUI/GMessageBox.h new file mode 100644 index 0000000000..fbbc371fba --- /dev/null +++ b/LibGUI/GMessageBox.h @@ -0,0 +1,16 @@ +#pragma once + +#include <LibGUI/GDialog.h> + +class GMessageBox : public GDialog { +public: + explicit GMessageBox(const String& text, const String& title, GObject* parent = nullptr); + virtual ~GMessageBox() override; + + String text() const { return m_text; } + + void build(); + +private: + String m_text; +}; |