Base: Update serenity-application template so that it compiles

This commit is contained in:
Tim Ledbetter 2023-09-15 18:05:42 +01:00 committed by Tim Flynn
parent 78ebeb6a5a
commit e7a5a2e146
Notes: sideshowbarker 2024-07-17 04:09:56 +09:00

View file

@ -5,7 +5,6 @@
#include <LibGUI/Frame.h>
#include <LibGUI/MessageBox.h>
#include <LibMain/Main.h>
#include <unistd.h>
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>());
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) {
GUI::MessageBox::show(window, "Hello friends!"sv, ":^)"sv);
};