[gtk: 1/2] dropdown: Add UI definition example




commit 5a0d6e3fc836f39a789406e207bcea99f53cbbb7
Author: Sonny Piers <sonny fastmail net>
Date:   Sun May 8 22:39:59 2022 +0200

    dropdown: Add UI definition example

 gtk/gtkdropdown.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/gtk/gtkdropdown.c b/gtk/gtkdropdown.c
index 30cb3fa172..e430892db9 100644
--- a/gtk/gtkdropdown.c
+++ b/gtk/gtkdropdown.c
@@ -68,6 +68,21 @@
  * useful if the list of options is long. To enable the search entry,
  * use [method@Gtk.DropDown.set_enable_search].
  *
+ * Here is a UI definition example for `GtkDropDown` with a simple model:
+ * ```xml
+ * <object class="GtkDropDown">
+ *   <property name="model">
+ *     <object class="GtkStringList">
+ *       <items>
+ *         <item translatable="yes">Factory</item>
+ *         <item translatable="yes">Home</item>
+ *         <item translatable="yes">Subway</item>
+ *       </items>
+ *     </object>
+ *   </property>
+ * </object>
+ * ```
+ *
  * # CSS nodes
  *
  * `GtkDropDown` has a single CSS node with name dropdown,


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