#include "hello_world.hpp" #include #include #include #include int main(int argc, char *argv[]) { auto app = Gtk::Application::create("org.gtkmm.example"); const auto menu_model = []() -> Glib::RefPtr { try { const auto builder = Gtk::Builder::create_from_file("menu_bar.ui"); return std::dynamic_pointer_cast(builder->get_object("menu")); } catch (const std::exception &e) { std::cerr << e.what() << '\n'; return nullptr; } }(); if (menu_model == nullptr) { std::cerr << "Menu model object is null. Down-cast failed.\n"; return EXIT_FAILURE; } return app->make_window_and_run(argc, argv, menu_model); }