1.23 <AdwComboRow>

Class: <AdwComboRow>

It derives from <AdwActionRow>.

A <GtkListBoxRow> used to choose from a list of items.

The <AdwComboRow> 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 <AdwComboRow> 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 ComboRow:selected and ComboRow:selected-item properties can be used to keep track of the selected item and react to their changes.

<AdwComboRow> mirrors <GtkDropDown>, see that widget for details.

<AdwComboRow> is list-box-row:activatable if a model is set.

CSS nodes

<AdwComboRow> 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 <GtkScrolledWindow>, which in turn contains a <GtkListView>, both are accessible via their regular nodes.

Accessibility

<AdwComboRow> uses the Gtk.AccessibleRole.combo-box role.

Fields

parent-instance

Properties

Property: combo-row:enable-search self

Whether to show a search entry in the popup.

If set to TRUE, a search entry will be shown in the popup that allows to search for items in the list.

Search requires ComboRow:expression to be set.

Its value is a boolean.

Set it with (set! (combo-row:enable-search self) value).

Property: combo-row:expression self

An expression used to obtain strings from items.

The expression must have a value type of G_TYPE_STRING.

It’s used to bind strings to labels produced by the default factory if ComboRow:factory is not set, or when ComboRow:use-subtitle is set to TRUE.

Its value is a <GtkExpression>, or #f.

Set it with (set! (combo-row:expression self) value).

Property: combo-row:factory self

Factory for populating list items.

This factory is always used for the item in the row. It is also used for items in the popup unless ComboRow:list-factory is set.

Its value is a <GtkListItemFactory>, or #f.

Set it with (set! (combo-row:factory self) value).

Property: combo-row:header-factory self

The factory for creating header widgets for the popup.

Its value is a <GtkListItemFactory>, or #f.

Set it with (set! (combo-row:header-factory self) value).

Property: combo-row:list-factory self

The factory for populating list items in the popup.

If this is not set, ComboRow:factory is used.

Its value is a <GtkListItemFactory>, or #f.

Set it with (set! (combo-row:list-factory self) value).

Property: combo-row:model self

The model that provides the displayed items.

Its value is a <GListModel>, or #f.

Set it with (set! (combo-row:model self) value).

Property: combo-row:search-match-mode self

The match mode for the search filter.

Its value is a <GtkStringFilterMatchMode> (or, to set it, one of its symbols).

Set it with (set! (combo-row:search-match-mode self) value).

Property: combo-row:selected self

The position of the selected item.

If no item is selected, the property has the value Gtk.INVALID_LIST_POSITION

Its value is an unsigned 32-bit integer.

Set it with (set! (combo-row:selected self) value).

Property: combo-row:selected-item self

The selected item.

Its value is a <GObject>, or #f.

It is read only.

Property: combo-row:use-subtitle self

Whether to use the current value as the subtitle.

If you use a custom list item factory, you will need to give the row a name conversion expression with ComboRow:expression.

If set to TRUE, you should not access ActionRow:subtitle.

The subtitle is interpreted as Pango markup if PreferencesRow:use-markup is set to TRUE.

Its value is a boolean.

Set it with (set! (combo-row:use-subtitle self) value).

Procedures

Method: combo-row:get-enable-search? self ⇒ %return
Method: get-enable-search? self ⇒ %return

Gets whether search is enabled.

If set to TRUE, a search entry will be shown in the popup that allows to search for items in the list.

Search requires ComboRow:expression to be set.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a boolean.

whether the popup includes a search entry

Method: combo-row:get-expression self ⇒ %return
Method: get-expression self ⇒ %return

Gets the expression used to obtain strings from items.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a <GtkExpression>, or #f.

the expression used to obtain strings from items

Method: combo-row:get-factory self ⇒ %return
Method: get-factory self ⇒ %return

Gets the factory for populating list items.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a <GtkListItemFactory>, or #f.

the factory in use

Method: combo-row:get-header-factory self ⇒ %return
Method: get-header-factory self ⇒ %return

Gets the factory that’s currently used to create header widgets for the popup.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a <GtkListItemFactory>, or #f.

The factory in use

Method: combo-row:get-list-factory self ⇒ %return
Method: get-list-factory self ⇒ %return

Gets the factory for populating list items in the popup.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a <GtkListItemFactory>, or #f.

the factory in use

Method: combo-row:get-model self ⇒ %return
Method: get-model self ⇒ %return

Gets the model that provides the displayed items.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a <GListModel>, or #f.

The model in use

Method: combo-row:get-search-match-mode self ⇒ %return
Method: get-search-match-mode self ⇒ %return

Returns the match mode that the search filter is using.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a <GtkStringFilterMatchMode>.

the match mode of the search filter

Method: combo-row:get-selected self ⇒ %return
Method: get-selected self ⇒ %return

Gets the position of the selected item.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: an unsigned 32-bit integer.

the position of the selected item, or Gtk.INVALID_LIST_POSITION if no item is selected

Method: combo-row:get-selected-item self ⇒ %return
Method: get-selected-item self ⇒ %return

Gets the selected item.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a <GObject>, or #f.

the selected item

Method: combo-row:get-use-subtitle? self ⇒ %return
Method: get-use-subtitle? self ⇒ %return

Gets whether to use the current value as the subtitle.

self

Passed: a <AdwComboRow>.

a combo row

%return

Returned: a boolean.

whether to use the current value as the subtitle

Procedure: combo-row:new ⇒ %return

Creates a new <AdwComboRow>.

%return

Returned: a <GtkWidget>.

the newly created <AdwComboRow>

Method: combo-row:set-enable-search self enable-search
Method: set-enable-search self enable-search

Sets whether to enable search.

If set to TRUE, a search entry will be shown in the popup that allows to search for items in the list.

Search requires ComboRow:expression to be set.

self

Passed: a <AdwComboRow>.

a combo row

enable-search

Passed: a boolean.

whether to enable search

Method: combo-row:set-expression self [expression]
Method: set-expression self [expression]

Sets the expression used to obtain strings from items.

The expression must have a value type of G_TYPE_STRING.

It’s used to bind strings to labels produced by the default factory if ComboRow:factory is not set, or when ComboRow:use-subtitle is set to TRUE.

self

Passed: a <AdwComboRow>.

a combo row

expression

Passed, or left out: a <GtkExpression>, or #f.

an expression

Method: combo-row:set-factory self [factory]
Method: set-factory self [factory]

Sets the factory for populating list items.

This factory is always used for the item in the row. It is also used for items in the popup unless ComboRow:list-factory is set.

self

Passed: a <AdwComboRow>.

a combo row

factory

Passed, or left out: a <GtkListItemFactory>, or #f.

the factory to use

Method: combo-row:set-header-factory self [factory]
Method: set-header-factory self [factory]

Sets the factory to use for creating header widgets for the popup.

self

Passed: a <AdwComboRow>.

a combo row

factory

Passed, or left out: a <GtkListItemFactory>, or #f.

the factory to use

Method: combo-row:set-list-factory self [factory]
Method: set-list-factory self [factory]

Sets the factory for populating list items in the popup.

If this is not set, ComboRow:factory is used.

self

Passed: a <AdwComboRow>.

a combo row

factory

Passed, or left out: a <GtkListItemFactory>, or #f.

the factory to use

Method: combo-row:set-model self [model]
Method: set-model self [model]

Sets the model that provides the displayed items.

self

Passed: a <AdwComboRow>.

a combo row

model

Passed, or left out: a <GListModel>, or #f.

the model to use

Method: combo-row:set-search-match-mode self search-match-mode
Method: set-search-match-mode self search-match-mode

Sets the match mode for the search filter.

self

Passed: a <AdwComboRow>.

a combo row

search-match-mode

Passed: a <GtkStringFilterMatchMode>, or one of its symbols.

the new match mode

Method: combo-row:set-selected self position
Method: set-selected self position

Selects the item at the given position.

self

Passed: a <AdwComboRow>.

a combo row

position

Passed: an unsigned 32-bit integer.

the position of the item to select, or Gtk.INVALID_LIST_POSITION

Method: combo-row:set-use-subtitle self use-subtitle
Method: set-use-subtitle self use-subtitle

Sets whether to use the current value as the subtitle.

If you use a custom list item factory, you will need to give the row a name conversion expression with ComboRow:expression.

If set to TRUE, you should not access ActionRow:subtitle.

The subtitle is interpreted as Pango markup if PreferencesRow:use-markup is set to TRUE.

self

Passed: a <AdwComboRow>.

a combo row

use-subtitle

Passed: a boolean.

whether to use the current value as the subtitle