summaryrefslogtreecommitdiff
path: root/gtk/gtkmenu.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-08-17 18:09:35 -0400
committerRyan Lortie <desrt@desrt.ca>2012-08-20 13:09:04 -0400
commitd30d56452cbd8d1c495c902018df17dee14875c8 (patch)
tree83fa4421d6d170fd063dab7742f1e1d75d378d82 /gtk/gtkmenu.c
parent2e578194770653e84caf495eddc481f562118b44 (diff)
downloadgtk+-d30d56452cbd8d1c495c902018df17dee14875c8.tar.gz
GtkWidget: Add gtk_widget_insert_action_group()
This allows adding a GActionGroup with a given name at an arbitrary point in the widget tree. This patch also adds an internal _get_action_muxer() API. Calling this will create a GActionMuxer associated with the widget. The parent of the muxer will be the muxer of the widget's conceptual parent. For non-menus, that is the normal parent. For menus, it is the attach widget. In this way, we end up with a hierarchy of GActionMuxer that largely reflects the hierarchy of GtkWidget, but only in places that the action context has been requested. These muxers are the ones on which the inserted actions groups are installed. A following patch will add a user of this API.
Diffstat (limited to 'gtk/gtkmenu.c')
-rw-r--r--gtk/gtkmenu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 9f0bfee818..6667ed5f6d 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1220,6 +1220,8 @@ gtk_menu_attach_to_widget (GtkMenu *menu,
/* Attach the widget to the toplevel window. */
gtk_window_set_attached_to (GTK_WINDOW (menu->priv->toplevel), attach_widget);
+ _gtk_widget_update_parent_muxer (GTK_WIDGET (menu));
+
/* Fallback title for menu comes from attach widget */
gtk_menu_update_title (menu);
@@ -1294,6 +1296,8 @@ gtk_menu_detach (GtkMenu *menu)
g_slice_free (GtkMenuAttachData, data);
+ _gtk_widget_update_parent_muxer (GTK_WIDGET (menu));
+
/* Fallback title for menu comes from attach widget */
gtk_menu_update_title (menu);