DropDown


Object Hierarchy:

Gtk.DropDown Gtk.DropDown Gtk.DropDown Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.DropDown GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.DropDown Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.DropDown Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.DropDown Gtk.ConstraintTarget->Gtk.Widget

Description:

[ CCode ( type_id = "gtk_drop_down_get_type ()" ) ]
public class DropDown : Widget, Accessible, Buildable, ConstraintTarget

`GtkDropDown` is a widget that allows the user to choose an item from a list of options.

![An example GtkDropDown](drop-down.png)

The `GtkDropDown` displays the selected choice.

The options are given to `GtkDropDown` in the form of `GListModel` and how the individual options are represented is determined by a [ [email protected]]. The default factory displays simple strings.

`GtkDropDown` knows how to obtain strings from the items in a [[email protected]]; for other models, you have to provide an expression to find the strings via [[email protected]_expression].

`GtkDropDown` can optionally allow search in the popup, which is useful if the list of options is long. To enable the search entry, use [ [email protected]_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, with the button and popover nodes as children.

Accessibility

`GtkDropDown` uses the gtk_accessible_role_combo_box role.


Namespace: Gtk
Package: gtk4

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object



2022 vala-language.org