Pong: Add menus before showing the window

Otherwise, space is reserved but menus aren't shown.
This commit is contained in:
LuK1337 2021-07-28 11:35:39 +02:00 committed by Gunnar Beutner
parent 64a98d0f90
commit 7f99497378
Notes: sideshowbarker 2024-07-18 07:41:47 +09:00

View file

@ -53,7 +53,6 @@ int main(int argc, char** argv)
window->set_double_buffering_enabled(false);
window->set_main_widget<Pong::Game>();
window->set_resizable(false);
window->show();
auto& game_menu = window->add_menu("&Game");
game_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
@ -63,5 +62,7 @@ int main(int argc, char** argv)
auto& help_menu = window->add_menu("&Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Pong", app_icon, window));
window->show();
return app->exec();
}