mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
Pong: TRY() all the things in serenity_main() :^)
This commit is contained in:
parent
aa2bc6fd47
commit
498d8bf1d7
1 changed files with 6 additions and 6 deletions
|
@ -31,16 +31,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
window->set_icon(app_icon.bitmap_for_size(16));
|
window->set_icon(app_icon.bitmap_for_size(16));
|
||||||
window->set_title("Pong");
|
window->set_title("Pong");
|
||||||
window->set_double_buffering_enabled(false);
|
window->set_double_buffering_enabled(false);
|
||||||
window->set_main_widget<Pong::Game>();
|
TRY(window->try_set_main_widget<Pong::Game>());
|
||||||
window->set_resizable(false);
|
window->set_resizable(false);
|
||||||
|
|
||||||
auto& game_menu = window->add_menu("&Game");
|
auto game_menu = TRY(window->try_add_menu("&Game"));
|
||||||
game_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
TRY(game_menu->try_add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
||||||
GUI::Application::the()->quit();
|
GUI::Application::the()->quit();
|
||||||
}));
|
})));
|
||||||
|
|
||||||
auto& help_menu = window->add_menu("&Help");
|
auto help_menu = TRY(window->try_add_menu("&Help"));
|
||||||
help_menu.add_action(GUI::CommonActions::make_about_action("Pong", app_icon, window));
|
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Pong", app_icon, window)));
|
||||||
|
|
||||||
window->show();
|
window->show();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue