adw.combo_row
Module for [ComboRow] class
Types 3
A [gtk.list_box_row.ListBoxRow] used to choose from a list of items.
The [adw.combo_row.ComboRow] widget allows the user to choose from a list of valid choices. The row displays the selected choice. When activated, the row displays a popover which allows the user to make a new choice.
Example of an [adw.combo_row.ComboRow] UI definition:
<object class="AdwComboRow">
<property name="title" translatable="yes">Combo Row</property>
<property name="model">
<object class="GtkStringList">
<items>
<item translatable="yes">Foo</item>
<item translatable="yes">Bar</item>
<item translatable="yes">Baz</item>
</items>
</object>
</property>
</object>The property@ComboRow:selected and property@ComboRow:selected-item properties can be used to keep track of the selected item and react to their changes.
[adw.combo_row.ComboRow] mirrors [gtk.drop_down.DropDown], see that widget for details.
[adw.combo_row.ComboRow] is [gtk.list_box_row.ListBoxRow.activatable] if a model is set.
CSS nodes
[adw.combo_row.ComboRow] has a main CSS node with name row and the .combo style class.
Its popover has the node named popover with the .menu style class, it contains a [gtk.scrolled_window.ScrolledWindow], which in turn contains a [gtk.list_view.ListView], both are accessible via their regular nodes.
Accessibility
[adw.combo_row.ComboRow] uses the [gtk.types.AccessibleRole.ComboBox] role.
ComboRowGidBuilder builder()Get builder for [adw.combo_row.ComboRow] Returns: New builder objectbool enableSearch() @propertyGet `enableSearch` property. Returns: Whether to show a search entry in the popup.void enableSearch(bool propval) @propertySet `enableSearch` property. Params: propval = Whether to show a search entry in the popup.gtk.expression.Expression expression() @propertyGet `expression` property. Returns: An expression used to obtain strings from items.void expression(gtk.expression.Expression propval) @propertySet `expression` property. Params: propval = An expression used to obtain strings from items.gtk.list_item_factory.ListItemFactory factory() @propertyGet `factory` property. Returns: Factory for populating list items.void factory(gtk.list_item_factory.ListItemFactory propval) @propertySet `factory` property. Params: propval = Factory for populating list items.gtk.list_item_factory.ListItemFactory listFactory() @propertyGet `listFactory` property. Returns: The factory for populating list items in the popup.void listFactory(gtk.list_item_factory.ListItemFactory propval) @propertySet `listFactory` property. Params: propval = The factory for populating list items in the popup.gio.list_model.ListModel model() @propertyGet `model` property. Returns: The model that provides the displayed items.void model(gio.list_model.ListModel propval) @propertySet `model` property. Params: propval = The model that provides the displayed items.void selected(uint propval) @propertySet `selected` property. Params: propval = The position of the selected item.gobject.object.ObjectWrap selectedItem() @propertyGet `selectedItem` property. Returns: The selected item.bool useSubtitle() @propertyGet `useSubtitle` property. Returns: Whether to use the current value as the subtitle.void useSubtitle(bool propval) @propertySet `useSubtitle` property. Params: propval = Whether to use the current value as the subtitle.bool getEnableSearch()Gets whether search is enabled.gtk.expression.Expression getExpression()Gets the expression used to obtain strings from items. Returns: the expression used to obtain strings from itemsgtk.list_item_factory.ListItemFactory getFactory()Gets the factory for populating list items. Returns: the factory in usegtk.list_item_factory.ListItemFactory getListFactory()Gets the factory for populating list items in the popup. Returns: the factory in usegio.list_model.ListModel getModel()Gets the model that provides the displayed items. Returns: The model in useuint getSelected()Gets the position of the selected item. Returns: the position of the selected item, or [gtk.types.INVALIDLISTPOSITION] if no item is selectedgobject.object.ObjectWrap getSelectedItem()Gets the selected item. Returns: the selected itembool getUseSubtitle()Gets whether to use the current value as the subtitle. Returns: whether to use the current value as the subtitlevoid setEnableSearch(bool enableSearch)Sets whether to enable search.void setExpression(gtk.expression.Expression expression = null)Sets the expression used to obtain strings from items.void setFactory(gtk.list_item_factory.ListItemFactory factory = null)Sets the factory for populating list items.void setListFactory(gtk.list_item_factory.ListItemFactory factory = null)Sets the factory for populating list items in the popup.void setModel(gio.list_model.ListModel model = null)Sets the model that provides the displayed items.void setSelected(uint position)Selects the item at the given position.void setUseSubtitle(bool useSubtitle)Sets whether to use the current value as the subtitle.T enableSearch(bool propval)Set `enableSearch` property. Params: propval = Whether to show a search entry in the popup.T expression(gtk.expression.Expression propval)Set `expression` property. Params: propval = An expression used to obtain strings from items.T factory(gtk.list_item_factory.ListItemFactory propval)Set `factory` property. Params: propval = Factory for populating list items.T listFactory(gtk.list_item_factory.ListItemFactory propval)Set `listFactory` property. Params: propval = The factory for populating list items in the popup.T model(gio.list_model.ListModel propval)Set `model` property. Params: propval = The model that provides the displayed items. Returns: Builder instance for fluent chainingT selected(uint propval)Set `selected` property. Params: propval = The position of the selected item.T useSubtitle(bool propval)Set `useSubtitle` property. Params: propval = Whether to use the current value as the subtitle.