[gtk+/popover-menu-buttons: 6/6] Document iconic section support



commit 2ab13aeeafd70bae0e069bee307434a1850f89b7
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Apr 26 14:38:07 2014 -0400

    Document iconic section support

 gtk/gtkpopover.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 85cb7f8..63b6f3d 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -37,6 +37,40 @@
  * is desired on a popover, gtk_popover_set_modal() may be called on it
  * to tweak its behavior.
  *
+ * ## GtkPopover as menu replacement
+ *
+ * GtkPopover is often used to replace menus. To facilitate this, it
+ * supports being populated from a #GMenuModel, using
+ * gtk_popover_new_from_model(). In addition to all the regular menu
+ * model features, this function supports rendering sections in the
+ * model in a more compact form, as a row of icon buttons instead of
+ * menu items.
+ *
+ * To use this rendering, set the ”display-hint” attribute
+ * of the section to ”iconic” and set the icons of your items with
+ * the ”verb-icon” attribute.
+ *
+ * |[
+ * <section>
+ *   <attribute name="display-hint">iconic</attribute>
+ *   <item>
+ *     <attribute name="label">Cut</attribute>
+ *     <attribute name="action">app.cut</attribute>
+ *     <attribute name="verb-icon">edit-cut-symbolic</attribute>
+ *   </item>
+ *   <item>
+ *     <attribute name="label">Copy</attribute>
+ *     <attribute name="action">app.copy</attribute>
+ *     <attribute name="verb-icon">edit-copy-symbolic</attribute>
+ *   </item>
+ *   <item>
+ *     <attribute name="label">Paste</attribute>
+ *     <attribute name="action">app.paste</attribute>
+ *     <attribute name="verb-icon">edit-paste-symbolic</attribute>
+ *   </item>
+ * </section>
+ * ]|
+ *
  * Since: 3.12
  */
 


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