diff --git a/examples/bp/Makefile.am b/examples/bp/Makefile.am index 827432d258..ed1a486af0 100644 --- a/examples/bp/Makefile.am +++ b/examples/bp/Makefile.am @@ -19,7 +19,7 @@ nodist_bloatpad_SOURCES = bloatpad-gresources.c resource_files = \ bloatpad.gresources.xml \ - menus.ui + gtk/menus.ui bloatpad-gresources.c: $(resource_files) $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $< diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c index c0e2d7d507..1ca129ec97 100644 --- a/examples/bp/bloatpad.c +++ b/examples/bp/bloatpad.c @@ -509,7 +509,6 @@ bloat_pad_startup (GApplication *application) { BloatPad *bloatpad = (BloatPad*) application; GtkApplication *app = GTK_APPLICATION (application); - GtkBuilder *builder; GMenu *menu; GMenuItem *item; GIcon *icon; @@ -537,13 +536,10 @@ bloat_pad_startup (GApplication *application) g_action_map_add_action_entries (G_ACTION_MAP (application), app_entries, G_N_ELEMENTS (app_entries), application); - builder = gtk_builder_new_from_resource ("/org/gtk/bloatpad/menus.ui"); - gtk_application_set_app_menu (app, G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"))); - gtk_application_set_menubar (app, G_MENU_MODEL (gtk_builder_get_object (builder, "menubar"))); for (i = 0; i < G_N_ELEMENTS (accels); i++) gtk_application_set_accels_for_action (app, accels[i].action_and_target, accels[i].accelerators); - menu = G_MENU (gtk_builder_get_object (builder, "icon-menu")); + menu = gtk_application_get_menu_by_id (GTK_APPLICATION (application), "icon-menu"); file = g_file_new_for_path (SRCDIR "/../gtk/stock-icons/16/help-about.png"); icon = g_file_icon_new (file); @@ -609,8 +605,7 @@ bloat_pad_startup (GApplication *application) dump_accels (GTK_APPLICATION (application)); //gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"))); - bloatpad->time = G_MENU (gtk_builder_get_object (builder, "time-menu")); - g_object_unref (builder); + bloatpad->time = gtk_application_get_menu_by_id (GTK_APPLICATION (application), "time-menu"); } static void diff --git a/examples/bp/bloatpad.gresources.xml b/examples/bp/bloatpad.gresources.xml index beee6b27e0..2e5c42314b 100644 --- a/examples/bp/bloatpad.gresources.xml +++ b/examples/bp/bloatpad.gresources.xml @@ -2,6 +2,6 @@ - menus.ui + gtk/menus.ui diff --git a/examples/bp/menus.ui b/examples/bp/gtk/menus.ui similarity index 100% rename from examples/bp/menus.ui rename to examples/bp/gtk/menus.ui