diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-04-18 07:11:15 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-04-18 07:11:15 -0400 |
commit | a37ddbe74b8670b4c83a3b85e97bb29a8cf6fe12 (patch) | |
tree | e9b903c052c6b2afa47a726400adbecf51665e11 /gtk/gtkmenushell.c | |
parent | 9f0ee69552160237fed28554220a49cec0352c3c (diff) | |
download | gtk+-a37ddbe74b8670b4c83a3b85e97bb29a8cf6fe12.tar.gz |
menu binding docs: Link to insert_action_group()
It's pretty useless to make a menu without actions behind it and people
who are using gtk_menu_shell_bind_model() directly are probably not
interested in doing it the GtkApplicationWindow way (so they won't get
the "app" and "win" groups for free). People are going to need to call
gtk_widget_insert_action_group(), so mention this in the docs to help
them along.
Diffstat (limited to 'gtk/gtkmenushell.c')
-rw-r--r-- | gtk/gtkmenushell.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index ad5d2d274a..28b3e1ad24 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -2100,6 +2100,16 @@ gtk_menu_shell_tracker_remove_func (gint position, * mentioned and @action_namespace is "app" then the effective action * name is "app.quit". * + * This function uses #GtkActionable to define the action name and + * target values on the created menu items. If you want to use an + * action group other than "app" and "win", or if you want to use a + * #GtkMenuShell outside of a #GtkApplicationWindow, then you will need + * to attach your own action group to the widget hierarchy using + * gtk_widget_insert_action_group(). As an example, if you created a + * group with a "quit" action and inserted it with the name "mygroup" + * then you would use the action name "mygroup.quit" in your + * #GMenuModel. + * * For most cases you are probably better off using * gtk_menu_new_from_model() or gtk_menu_bar_new_from_model() or just * directly passing the #GMenuModel to gtk_application_set_app_menu() or |