mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
LibGUI: Implement destroying individual windows without exiting the process.
This commit is contained in:
parent
5c25f0c4db
commit
37ab7b7a8c
8 changed files with 85 additions and 30 deletions
|
@ -63,11 +63,11 @@ GWindow* make_launcher_window()
|
|||
{
|
||||
auto* window = new GWindow;
|
||||
window->set_title("Launcher");
|
||||
window->set_rect({ 100, 400, 100, 200 });
|
||||
window->set_rect({ 100, 400, 100, 230 });
|
||||
|
||||
auto* widget = new GWidget;
|
||||
window->set_main_widget(widget);
|
||||
widget->set_relative_rect({ 0, 0, 100, 200 });
|
||||
widget->set_relative_rect({ 0, 0, 100, 230 });
|
||||
|
||||
auto* label = new GLabel(widget);
|
||||
label->set_relative_rect({ 0, 0, 100, 20 });
|
||||
|
@ -124,5 +124,12 @@ GWindow* make_launcher_window()
|
|||
|
||||
window->set_focused_widget(textbox);
|
||||
|
||||
auto* close_button = new GButton(widget);
|
||||
close_button->set_relative_rect({ 5, 200, 90, 20 });
|
||||
close_button->set_caption("Close");
|
||||
close_button->on_click = [window] (GButton&) {
|
||||
window->close();
|
||||
};
|
||||
|
||||
return window;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue