Gtk.ColumnViewCell¶
class — extends ListItem
Represents items in a cell in ColumnView.
The GtkColumnViewCells are managed by the ColumnView
widget (with its factory) and cannot be created by applications, but
they need to be populated by application code. This is done by calling
ColumnViewCell.set_child.
GtkColumnViewCells exist in 2 stages:
-
The unbound stage where the listitem is not currently connected to an item in the list. In that case, the
ColumnViewCell.itemproperty is set toNone. -
The bound stage where the listitem references an item from the list. The
ColumnViewCell.itemproperty is notNone.
Methods¶
get_child¶
Gets the child previously set via ColumnViewCell.set_child or
None if none was set.
get_focusable¶
Checks if a list item has been set to be focusable via
ColumnViewCell.set_focusable.
get_item¶
Gets the model item that associated with self.
If self is unbound, this function returns None.
get_position¶
Gets the position in the model that self currently displays.
If self is unbound, INVALID_LIST_POSITION is returned.
get_selected¶
Checks if the item is displayed as selected.
The selected state is maintained by the list widget and its model and cannot be set otherwise.
set_child¶
Sets the child to be used for this listitem.
This function is typically called by applications when setting up a listitem so that the widget can be reused when binding it multiple times.
Parameters:
child— The list item's child orNoneto unset
set_focusable¶
Sets self to be focusable.
If an item is focusable, it can be focused using the keyboard.
This works similar to Widget.set_focusable.
Note that if items are not focusable, the keyboard cannot be used to activate them and selecting only works if one of the listitem's children is focusable.
By default, list items are focusable.
Parameters:
focusable— if the item should be focusable
Properties¶
child¶
Widget used for display.
focusable¶
If the item can be focused with the keyboard.
item¶
Displayed item.
position¶
Position of the item.
selected¶
If the item is currently selected.