gtk-demo: Replace a menu with a popover
authorMatthias Clasen <mclasen@redhat.com>
Fri, 27 Dec 2019 02:06:56 +0000 (21:06 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 29 Dec 2019 23:45:40 +0000 (18:45 -0500)
demos/gtk-demo/application.c

index 7ed8ef6e1d4935c3dfa2ba2af667f36023640b61..92034b5e43cf621c13bdd3d603e92ca335efb64d 100644 (file)
@@ -419,7 +419,7 @@ demo_application_window_load_state (DemoApplicationWindow *win)
 static void
 demo_application_window_init (DemoApplicationWindow *window)
 {
-  GtkWidget *menu;
+  GtkWidget *popover;
 
   window->width = -1;
   window->height = -1;
@@ -428,8 +428,8 @@ demo_application_window_init (DemoApplicationWindow *window)
 
   gtk_widget_init_template (GTK_WIDGET (window));
 
-  menu = gtk_menu_new_from_model (window->toolmenu);
-  gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (window->menutool), menu);
+  popover = gtk_popover_menu_new_from_model (window->menutool, window->toolmenu);
+  gtk_menu_tool_button_set_popover (GTK_MENU_TOOL_BUTTON (window->menutool), popover);
 
   g_action_map_add_action_entries (G_ACTION_MAP (window),
                                    win_entries, G_N_ELEMENTS (win_entries),