dropdown: Add UI definition example
authorSonny Piers <sonny@fastmail.net>
Sun, 8 May 2022 20:39:59 +0000 (22:39 +0200)
committerSonny Piers <sonny@fastmail.net>
Sun, 8 May 2022 20:52:05 +0000 (22:52 +0200)
gtk/gtkdropdown.c

index 30cb3fa172764c07585368ec431b72ddf77f4a87..e430892db9e79a779dfb882d0d86432816e46670 100644 (file)
  * 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,