mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
Base: Update serenity-application template so that it compiles
This commit is contained in:
parent
78ebeb6a5a
commit
e7a5a2e146
1 changed files with 2 additions and 3 deletions
|
@ -5,7 +5,6 @@
|
||||||
#include <LibGUI/Frame.h>
|
#include <LibGUI/Frame.h>
|
||||||
#include <LibGUI/MessageBox.h>
|
#include <LibGUI/MessageBox.h>
|
||||||
#include <LibMain/Main.h>
|
#include <LibMain/Main.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
|
@ -23,9 +22,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
|
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
|
||||||
main_widget->set_fill_with_background_color(true);
|
main_widget->set_fill_with_background_color(true);
|
||||||
|
|
||||||
TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(16));
|
main_widget->set_layout<GUI::VerticalBoxLayout>(16);
|
||||||
|
|
||||||
auto button = TRY(main_widget->try_add<GUI::Button>("Click me!"));
|
auto button = TRY(main_widget->try_add<GUI::Button>("Click me!"_string));
|
||||||
button->on_click = [&](auto) {
|
button->on_click = [&](auto) {
|
||||||
GUI::MessageBox::show(window, "Hello friends!"sv, ":^)"sv);
|
GUI::MessageBox::show(window, "Hello friends!"sv, ":^)"sv);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue