Object Hierarchy:

Object hierarchy for DropDown


[ 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 [ class@Gtk.ListItemFactory]. The default factory displays simple strings.

`GtkDropDown` knows how to obtain strings from the items in a [class@Gtk.StringList]; for other models, you have to provide an expression to find the strings via [method@Gtk.DropDown.set_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 [ method@Gtk.DropDown.set_enable_search].

CSS nodes

`GtkDropDown` has a single CSS node with name dropdown, with the button and popover nodes as children.


`GtkDropDown` uses the gtk_accessible_role_combo_box role.

Namespace: Gtk
Package: gtk4



Creation methods:



Inherited Members:

All known members inherited from class Gtk.Widget