mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
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.
This commit is contained in:
parent
55aa819077
commit
57ff293a51
29 changed files with 275 additions and 79 deletions
16
LibGUI/GMessageBox.h
Normal file
16
LibGUI/GMessageBox.h
Normal file
|
@ -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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue