ComboRow

A gtk.list_box_row.ListBoxRow used to choose from a list of items.

<picture> <source srcset="combo-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="combo-row.png" alt="combo-row"> </picture>

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.gboolean 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.

Constructors

this
this()

Creates a new adw.combo_row.ComboRow.

Members

Functions

getEnableSearch
bool getEnableSearch()

Gets whether search is enabled.

getExpression
gtk.expression.Expression getExpression()

Gets the expression used to obtain strings from items.

getFactory
gtk.list_item_factory.ListItemFactory getFactory()

Gets the factory for populating list items.

getListFactory
gtk.list_item_factory.ListItemFactory getListFactory()

Gets the factory for populating list items in the popup.

getModel
gio.list_model.ListModel getModel()

Gets the model that provides the displayed items.

getSelected
uint getSelected()

Gets the position of the selected item.

getSelectedItem
gobject.object.ObjectG getSelectedItem()

Gets the selected item.

getUseSubtitle
bool getUseSubtitle()

Gets whether to use the current value as the subtitle.

setEnableSearch
void setEnableSearch(bool enableSearch)

Sets whether to enable search.

setExpression
void setExpression(gtk.expression.Expression expression)

Sets the expression used to obtain strings from items.

setFactory
void setFactory(gtk.list_item_factory.ListItemFactory factory)

Sets the factory for populating list items.

setListFactory
void setListFactory(gtk.list_item_factory.ListItemFactory factory)

Sets the factory for populating list items in the popup.

setModel
void setModel(gio.list_model.ListModel model)

Sets the model that provides the displayed items.

setSelected
void setSelected(uint position)

Selects the item at the given position.

setUseSubtitle
void setUseSubtitle(bool useSubtitle)

Sets whether to use the current value as the subtitle.

Inherited Members

From ActionRow

activate
void activate()

Activates self.

addPrefix
void addPrefix(gtk.widget.Widget widget)

Adds a prefix widget to self.

addSuffix
void addSuffix(gtk.widget.Widget widget)

Adds a suffix widget to self.

getActivatableWidget
gtk.widget.Widget getActivatableWidget()

Gets the widget activated when self is activated.

getIconName
string getIconName()

Gets the icon name for self.

getSubtitle
string getSubtitle()

Gets the subtitle for self.

getSubtitleLines
int getSubtitleLines()

Gets the number of lines at the end of which the subtitle label will be ellipsized.

getSubtitleSelectable
bool getSubtitleSelectable()

Gets whether the user can copy the subtitle from the label

getTitleLines
int getTitleLines()

Gets the number of lines at the end of which the title label will be ellipsized.

remove
void remove(gtk.widget.Widget widget)

Removes a child from self.

setActivatableWidget
void setActivatableWidget(gtk.widget.Widget widget)

Sets the widget to activate when self is activated.

setIconName
void setIconName(string iconName)

Sets the icon name for self.

setSubtitle
void setSubtitle(string subtitle)

Sets the subtitle for self.

setSubtitleLines
void setSubtitleLines(int subtitleLines)

Sets the number of lines at the end of which the subtitle label will be ellipsized.

setSubtitleSelectable
void setSubtitleSelectable(bool subtitleSelectable)

Sets whether the user can copy the subtitle from the label

setTitleLines
void setTitleLines(int titleLines)

Sets the number of lines at the end of which the title label will be ellipsized.

connectActivated
ulong connectActivated(T callback, Flag!"After" after)

Connect to Activated signal.