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

class ComboRow : ActionRow {}

Constructors

this
this(void* ptr, Flag!"Take" take)
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.ObjectWrap getSelectedItem()

Gets the selected item.

getUseSubtitle
bool getUseSubtitle()

Gets whether to use the current value as the subtitle.

self
ComboRow self()

Returns this, for use in with statements.

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.

Properties

enableSearch
bool enableSearch [@property getter]

Get enableSearch property.

enableSearch
bool enableSearch [@property setter]

Set enableSearch property.

expression
gtk.expression.Expression expression [@property getter]

Get expression property.

expression
gtk.expression.Expression expression [@property setter]

Set expression property.

factory
gtk.list_item_factory.ListItemFactory factory [@property getter]

Get factory property.

factory
gtk.list_item_factory.ListItemFactory factory [@property setter]

Set factory property.

gType
GType gType [@property getter]
listFactory
gtk.list_item_factory.ListItemFactory listFactory [@property getter]

Get listFactory property.

listFactory
gtk.list_item_factory.ListItemFactory listFactory [@property setter]

Set listFactory property.

model
gio.list_model.ListModel model [@property getter]

Get model property.

model
gio.list_model.ListModel model [@property setter]

Set model property.

selected
uint selected [@property getter]

Get selected property.

selected
uint selected [@property setter]

Set selected property.

selectedItem
gobject.object.ObjectWrap selectedItem [@property getter]

Get selectedItem property.

useSubtitle
bool useSubtitle [@property getter]

Get useSubtitle property.

useSubtitle
bool useSubtitle [@property setter]

Set useSubtitle property.

Static functions

getGType
GType getGType()

Inherited Members

From ActionRow

getGType
GType getGType()
gType
GType gType [@property getter]
self
ActionRow self()

Returns this, for use in with statements.

activatableWidget
gtk.widget.Widget activatableWidget [@property getter]

Get activatableWidget property.

activatableWidget
gtk.widget.Widget activatableWidget [@property setter]

Set activatableWidget property.

iconName
string iconName [@property getter]

Get iconName property.

iconName
string iconName [@property setter]

Set iconName property.

subtitle
string subtitle [@property getter]

Get subtitle property.

subtitle
string subtitle [@property setter]

Set subtitle property.

subtitleLines
int subtitleLines [@property getter]

Get subtitleLines property.

subtitleLines
int subtitleLines [@property setter]

Set subtitleLines property.

subtitleSelectable
bool subtitleSelectable [@property getter]

Get subtitleSelectable property.

subtitleSelectable
bool subtitleSelectable [@property setter]

Set subtitleSelectable property.

titleLines
int titleLines [@property getter]

Get titleLines property.

titleLines
int titleLines [@property setter]

Set titleLines property.

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.