[gtk/prop-list: 12/48] builderlistitemfactory: Add an example to the docs



commit e8886bd7775ad48de93a8d7348e17be8be0ec1a3
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 18 22:34:58 2019 -0500

    builderlistitemfactory: Add an example to the docs

 gtk/gtkbuilderlistitemfactory.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkbuilderlistitemfactory.c b/gtk/gtkbuilderlistitemfactory.c
index 182f276ddc..682b502dfb 100644
--- a/gtk/gtkbuilderlistitemfactory.c
+++ b/gtk/gtkbuilderlistitemfactory.c
@@ -32,7 +32,27 @@
  * @Short_description: A listitem factory using ui files
  *
  * #GtkBuilderListItemFactory is a #GtkListItemFactory that creates
- * widgets by instantiating #GtkBuilder UI templates.
+ * widgets by instantiating #GtkBuilder UI templates. The templates
+ * must be extending #GtkListItem, and typically use #GtkExpressions
+ * to obtain data from the items in the model.
+ *
+ * Example:
+ * |[
+ *   <interface>
+ *     <template class="GtkListItem">
+ *       <property name="child">
+ *         <object class="GtkLabel">
+ *           <property name="xalign">0</property>
+ *           <binding name="label">
+ *             <lookup name="name" type="SettingsKey">
+ *               <lookup name="item">GtkListItem</lookup>
+ *             </lookup>
+ *           </binding>
+ *         </object>
+ *       </property>
+ *     </template>
+ *   </interface>
+ * ]|
  */
 
 struct _GtkBuilderListItemFactory


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