mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:28:11 +00:00

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.
16 lines
314 B
C++
16 lines
314 B
C++
#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;
|
|
};
|