Skip to content

Gtk.ColumnViewRow

class — extends GObject.Object

Configures how rows are displayed in a ColumnView.

It is not used to set the widgets displayed in the individual cells. For that see GtkColumnViewColumn.set_factory and GtkColumnViewCell.

Methods

get_accessible_description

def get_accessible_description(self) -> str

Gets the accessible description of self.

get_accessible_label

def get_accessible_label(self) -> str

Gets the accessible label of self.

get_activatable

def get_activatable(self) -> bool

Checks if the row has been set to be activatable via ColumnViewRow.set_activatable.

get_focusable

def get_focusable(self) -> bool

Checks if a row item has been set to be focusable via ColumnViewRow.set_focusable.

get_item

def get_item(self) -> GObject.Object | None

Gets the model item that associated with self.

If self is unbound, this function returns None.

get_position

def get_position(self) -> int

Gets the position in the model that self currently displays.

If self is unbound, INVALID_LIST_POSITION is returned.

get_selectable

def get_selectable(self) -> bool

Checks if the row has been set to be selectable via ColumnViewRow.set_selectable.

Do not confuse this function with ColumnViewRow.get_selected.

get_selected

def get_selected(self) -> bool

Checks if the item is selected that this row corresponds to.

The selected state is maintained by the list widget and its model and cannot be set otherwise.

set_accessible_description

def set_accessible_description(self, description: str) -> None

Sets the accessible description for the row, which may be used by e.g. screen readers.

Parameters:

  • description — the description

set_accessible_label

def set_accessible_label(self, label: str) -> None

Sets the accessible label for the row, which may be used by e.g. screen readers.

Parameters:

  • label — the label

set_activatable

def set_activatable(self, activatable: bool) -> None

Sets self to be activatable.

If a row is activatable, double-clicking on the row, using the Return key or calling Widget.activate will activate the row. Activating instructs the containing columnview to emit the ColumnView.activate signal.

By default, row are activatable.

Parameters:

  • activatable — if the row should be activatable

set_focusable

def set_focusable(self, focusable: bool) -> None

Sets self to be focusable.

If a row is focusable, it can be focused using the keyboard. This works similar to Widget.set_focusable.

Note that if row are not focusable, the contents of cells can still be focused if they are focusable.

By default, rows are focusable.

Parameters:

  • focusable — if the row should be focusable

set_selectable

def set_selectable(self, selectable: bool) -> None

Sets self to be selectable.

If a row is selectable, clicking on the row or using the keyboard will try to select or unselect the row. Whether this succeeds is up to the model to determine, as it is managing the selected state.

Note that this means that making a row non-selectable has no influence on the selected state at all. A non-selectable row may still be selected.

By default, rows are selectable.

Parameters:

  • selectable — if the row should be selectable

Properties

accessible_description

accessible_description: str  # read/write

The accessible description to set on the row.

accessible_label

accessible_label: str  # read/write

The accessible label to set on the row.

activatable

activatable: bool  # read/write

If the row can be activated by the user.

focusable

focusable: bool  # read/write

If the row can be focused with the keyboard.

item

item: GObject.Object  # read-only

The item for this row.

position

position: int  # read-only

Position of the row.

selectable

selectable: bool  # read/write

If the row can be selected by the user.

selected

selected: bool  # read-only

If the item in the row is currently selected.