From 00d7e53621b5820bd4ab286a92e7e579986712fc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 9 May 2004 04:03:59 +0000 Subject: [PATCH] Make sure that we actually return menus for nodes of type menu, not the Sun May 9 00:03:03 2004 Matthias Clasen * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure that we actually return menus for nodes of type menu, not the menuitems they're attached to. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkuimanager.c | 13 +++++++++++-- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a64986134..48b78e78e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun May 9 00:03:03 2004 Matthias Clasen + + * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure + that we actually return menus for nodes of type menu, not the + menuitems they're attached to. + Sat May 8 22:50:55 2004 Matthias Clasen * gtk/gtkactiongroup.c (gtk_action_group_set_translation_domain): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6a64986134..48b78e78e2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Sun May 9 00:03:03 2004 Matthias Clasen + + * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure + that we actually return menus for nodes of type menu, not the + menuitems they're attached to. + Sat May 8 22:50:55 2004 Matthias Clasen * gtk/gtkactiongroup.c (gtk_action_group_set_translation_domain): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6a64986134..48b78e78e2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Sun May 9 00:03:03 2004 Matthias Clasen + + * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure + that we actually return menus for nodes of type menu, not the + menuitems they're attached to. + Sat May 8 22:50:55 2004 Matthias Clasen * gtk/gtkactiongroup.c (gtk_action_group_set_translation_domain): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6a64986134..48b78e78e2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Sun May 9 00:03:03 2004 Matthias Clasen + + * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Make sure + that we actually return menus for nodes of type menu, not the + menuitems they're attached to. + Sat May 8 22:50:55 2004 Matthias Clasen * gtk/gtkactiongroup.c (gtk_action_group_set_translation_domain): diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c index 9753998292..cfbfe4b217 100644 --- a/gtk/gtkuimanager.c +++ b/gtk/gtkuimanager.c @@ -708,12 +708,21 @@ gtk_ui_manager_get_widget (GtkUIManager *self, * widget */ gtk_ui_manager_ensure_update (self); + if (strncmp ("/ui", path, 3) == 0) + path += 3; node = get_node (self, path, NODE_TYPE_UNDECIDED, FALSE); if (node == NULL) return NULL; - return NODE_INFO (node)->proxy; + if (NODE_INFO (node)->type == NODE_TYPE_MENU) + { + GtkWidget *proxy = NODE_INFO (node)->proxy; + + return gtk_menu_item_get_submenu (GTK_MENU_ITEM (proxy)); + } + else + return NODE_INFO (node)->proxy; } static void @@ -928,7 +937,7 @@ get_node (GtkUIManager *self, create, FALSE); if (!node) return NULL; - + pos += length + 1; /* move past the node name and the slash too */ parent = node; }