Adw.ComboRow¶
- Subclasses:
None
Methods¶
- Inherited:
Adw.ActionRow (17), Adw.PreferencesRow (9), Gtk.ListBoxRow (12), Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1), Gtk.Actionable (5)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Adw.ActionRow (6), Adw.PreferencesRow (4), Gtk.ListBoxRow (3), Gtk.Widget (35), Gtk.Accessible (1), Gtk.Actionable (2)
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
Expression to determine strings to search for |
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r |
|||
r/w/en |
Signals¶
- Inherited:
Adw.ActionRow (1), Gtk.ListBoxRow (1), Gtk.Widget (13), GObject.Object (1)
Fields¶
- Inherited:
Adw.ActionRow (1), Gtk.ListBoxRow (1), Gtk.Widget (13), GObject.Object (1)
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Adw.ComboRow(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A [class`Gtk`.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
AdwComboRowwidget 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
AdwComboRowUI definition: ``xml <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`:py:data::selected<Adw.ComboRow.props.selected>] and [property`ComboRow`:py:data::selected-item<Adw.ComboRow.props.selected_item>] properties can be used to keep track of the selected item and react to their changes.
AdwComboRowmirrors [class`Gtk`.DropDown], see that widget for details.AdwComboRowis [property`Gtk`.ListBoxRow:activatable] if a model is set.- CSS nodes
AdwComboRowhas a main CSS node with namerowand the.combostyle class.Its popover has the node named
popoverwith the.menustyle class, it contains a [class`Gtk`.ScrolledWindow], which in turn contains a [class`Gtk`.ListView], both are accessible via their regular nodes.- Accessibility
AdwComboRowuses theGTK_ACCESSIBLE_ROLE_COMBO_BOXrole.- classmethod new()¶
- Returns:
the newly created
AdwComboRow- Return type:
Creates a new
AdwComboRow.
- get_enable_search()¶
- Returns:
whether the popup includes a search entry
- Return type:
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 [property`ComboRow`:py:data::expression<Adw.ComboRow.props.expression>] to be set.
New in version 1.4.
- get_expression()¶
- Returns:
the expression used to obtain strings from items
- Return type:
Gets the expression used to obtain strings from items.
- get_factory()¶
- Returns:
the factory in use
- Return type:
Gets the factory for populating list items.
- get_header_factory()¶
- Returns:
The factory in use
- Return type:
Gets the factory that’s currently used to create header widgets for the popup.
New in version 1.6.
- get_list_factory()¶
- Returns:
the factory in use
- Return type:
Gets the factory for populating list items in the popup.
- get_model()¶
- Returns:
The model in use
- Return type:
Gets the model that provides the displayed items.
- get_search_match_mode()¶
- Returns:
the match mode of the search filter
- Return type:
Returns the match mode that the search filter is using.
New in version 1.6.
- get_selected()¶
- Returns:
the position of the selected item, or [const`Gtk`.INVALID_LIST_POSITION] if no item is selected
- Return type:
Gets the position of the selected item.
- get_selected_item()¶
- Returns:
the selected item
- Return type:
Gets the selected item.
- get_use_subtitle()¶
- Returns:
whether to use the current value as the subtitle
- Return type:
Gets whether to use the current value as the subtitle.
- set_enable_search(enable_search)¶
- Parameters:
enable_search (
bool) – whether to 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 [property`ComboRow`:py:data::expression<Adw.ComboRow.props.expression>] to be set.
New in version 1.4.
- set_expression(expression)¶
- Parameters:
expression (
Gtk.ExpressionorNone) – an 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 [property`ComboRow`:py:data::factory<Adw.ComboRow.props.factory>] is not set, or when [property`ComboRow`:py:data::use-subtitle<Adw.ComboRow.props.use_subtitle>] is set to
TRUE.
- set_factory(factory)¶
- Parameters:
factory (
Gtk.ListItemFactoryorNone) – the factory to use
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 [property`ComboRow`:py:data::list-factory<Adw.ComboRow.props.list_factory>] is set.
- set_header_factory(factory)¶
- Parameters:
factory (
Gtk.ListItemFactoryorNone) – the factory to use
Sets the factory to use for creating header widgets for the popup.
New in version 1.6.
- set_list_factory(factory)¶
- Parameters:
factory (
Gtk.ListItemFactoryorNone) – the factory to use
Sets the factory for populating list items in the popup.
If this is not set, [property`ComboRow`:py:data::factory<Adw.ComboRow.props.factory>] is used.
- set_model(model)¶
- Parameters:
model (
Gio.ListModelorNone) – the model to use
Sets the model that provides the displayed items.
- set_search_match_mode(search_match_mode)¶
- Parameters:
search_match_mode (
Gtk.StringFilterMatchMode) – the new match mode
Sets the match mode for the search filter.
New in version 1.6.
- set_selected(position)¶
- Parameters:
position (
int) – the position of the item to select, or [const`Gtk`.INVALID_LIST_POSITION]
Selects the item at the given position.
- set_use_subtitle(use_subtitle)¶
- Parameters:
use_subtitle (
bool) – whether to use the current value as the 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 [property`ComboRow`:py:data::expression<Adw.ComboRow.props.expression>].
If set to
TRUE, you should not access [property`ActionRow`:py:data::subtitle<Adw.ComboRow.props.subtitle>].The subtitle is interpreted as Pango markup if [property`PreferencesRow`:py:data::use-markup<Adw.ComboRow.props.use_markup>] is set to
TRUE.
Property Details¶
- Adw.ComboRow.props.enable_search¶
- Name:
enable-search- Type:
- Default Value:
- Flags:
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 [property`ComboRow`:py:data::expression<Adw.ComboRow.props.expression>] to be set.
New in version 1.4.
- Adw.ComboRow.props.expression¶
- Name:
expression- Type:
- Default Value:
- Flags:
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 [property`ComboRow`:py:data::factory<Adw.ComboRow.props.factory>] is not set, or when [property`ComboRow`:py:data::use-subtitle<Adw.ComboRow.props.use_subtitle>] is set to
TRUE.
- Adw.ComboRow.props.factory¶
- Name:
factory- Type:
- Default Value:
- Flags:
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 [property`ComboRow`:py:data::list-factory<Adw.ComboRow.props.list_factory>] is set.
- Adw.ComboRow.props.header_factory¶
- Name:
header-factory- Type:
- Default Value:
- Flags:
The factory for creating header widgets for the popup.
New in version 1.6.
- Adw.ComboRow.props.list_factory¶
- Name:
list-factory- Type:
- Default Value:
- Flags:
The factory for populating list items in the popup.
If this is not set, [property`ComboRow`:py:data::factory<Adw.ComboRow.props.factory>] is used.
- Adw.ComboRow.props.model¶
- Name:
model- Type:
- Default Value:
- Flags:
The model that provides the displayed items.
- Adw.ComboRow.props.search_match_mode¶
- Name:
search-match-mode- Type:
- Default Value:
- Flags:
The match mode for the search filter.
New in version 1.6.
- Adw.ComboRow.props.selected¶
- Name:
selected- Type:
- Default Value:
4294967295- Flags:
The position of the selected item.
If no item is selected, the property has the value [const`Gtk`.INVALID_LIST_POSITION]
- Adw.ComboRow.props.selected_item¶
- Name:
selected-item- Type:
- Default Value:
- Flags:
The selected item.
- Adw.ComboRow.props.use_subtitle¶
- Name:
use-subtitle- Type:
- Default Value:
- Flags:
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 [property`ComboRow`:py:data::expression<Adw.ComboRow.props.expression>].
If set to
TRUE, you should not access [property`ActionRow`:py:data::subtitle<Adw.ComboRow.props.subtitle>].The subtitle is interpreted as Pango markup if [property`PreferencesRow`:py:data::use-markup<Adw.ComboRow.props.use_markup>] is set to
TRUE.