[gtk+] menu binding docs: Link to insert_action_group()



commit a37ddbe74b8670b4c83a3b85e97bb29a8cf6fe12
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Apr 18 07:11:15 2013 -0400

    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.

 gtk/gtkmenushell.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index ad5d2d2..28b3e1a 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]