diff options
author | Ryan Lortie <desrt@desrt.ca> | 2012-09-11 11:38:06 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2012-09-17 12:31:22 -0400 |
commit | dd143479fe85f16e4ea010a7b03d4365d9d9234e (patch) | |
tree | 6101e20075598591dcfa355c5c12f9c73b250937 /gtk/gtkmodelmenuitem.c | |
parent | 778aa7ade0107fa645ab1427132551d138c7334a (diff) | |
download | gtk+-dd143479fe85f16e4ea010a7b03d4365d9d9234e.tar.gz |
gtkmodelmenu: simplify logic, expose bind API
Make the main (and only) entry-point to gtkmodelmenu.c the now-public
gtk_menu_shell_bind_model().
Move the convenience constructors (gtk_menu_new_from_model() and
gtk_menu_bar_new_from_model()) to their proper files.
Remove the private header file.
Simplify the code a bit by making the initial populate part of the
bind() call.
https://bugzilla.gnome.org/show_bug.cgi?id=682831
Diffstat (limited to 'gtk/gtkmodelmenuitem.c')
-rw-r--r-- | gtk/gtkmodelmenuitem.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gtk/gtkmodelmenuitem.c b/gtk/gtkmodelmenuitem.c index 61e10e5a3c..6d902c2352 100644 --- a/gtk/gtkmodelmenuitem.c +++ b/gtk/gtkmodelmenuitem.c @@ -23,7 +23,6 @@ #include "gtkaccelmapprivate.h" #include "gtkactionhelper.h" -#include "gtkmodelmenu.h" #include "gtkwidgetprivate.h" #include "gtkaccellabel.h" @@ -121,17 +120,16 @@ gtk_model_menu_item_setup (GtkModelMenuItem *item, GtkWidget *menu; g_menu_model_get_item_attribute (model, item_index, "action-namespace", "s", §ion_namespace); + menu = gtk_menu_new (); if (action_namespace) { gchar *namespace = g_strjoin (".", action_namespace, section_namespace, NULL); - menu = gtk_model_menu_create_menu (submenu, namespace); + gtk_menu_shell_bind_model (GTK_MENU_SHELL (menu), submenu, namespace, TRUE); g_free (namespace); } else - { - menu = gtk_model_menu_create_menu (submenu, section_namespace); - } + gtk_menu_shell_bind_model (GTK_MENU_SHELL (menu), submenu, section_namespace, TRUE); gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu); |