:right-sidebar: True ColumnViewCell =================================================================== .. currentmodule:: gi.repository.Gtk .. versionadded:: 4.12 .. class:: ColumnViewCell(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.ListItem`, :class:`~gi.repository.GObject.Object` ``GtkColumnViewCell`` is used by :obj:`~gi.repository.Gtk.ColumnViewColumn` to represent items in a cell in :obj:`~gi.repository.Gtk.ColumnView`. The ``GtkColumnViewCell``'s 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 :obj:`~gi.repository.Gtk.ColumnViewCell.set_child`. ``GtkColumnViewCell``'s exist in 2 stages: 1. The unbound stage where the listitem is not currently connected to an item in the list. In that case, the :obj:`~gi.repository.Gtk.ColumnViewCell.props.item` property is set to :const:`None`. 2. The bound stage where the listitem references an item from the list. The :obj:`~gi.repository.Gtk.ColumnViewCell.props.item` property is not :const:`None`. Methods ------- .. rst-class:: interim-class .. class:: ColumnViewCell :no-index: .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child previously set via :func:`~gi.repository.Gtk.ColumnViewCell.set_child` or :const:`None` if none was set. .. versionadded:: 4.12 .. method:: get_focusable() -> bool Checks if a list item has been set to be focusable via :func:`~gi.repository.Gtk.ColumnViewCell.set_focusable`. .. versionadded:: 4.12 .. method:: get_item() -> ~gi.repository.GObject.Object | None Gets the model item that associated with ``self``. If ``self`` is unbound, this function returns :const:`None`. .. versionadded:: 4.12 .. method:: get_position() -> int Gets the position in the model that ``self`` currently displays. If ``self`` is unbound, :const:`~gi.repository.Gtk.INVALID_LIST_POSITION` is returned. .. versionadded:: 4.12 .. method:: get_selected() -> bool Checks if the item is displayed as selected. The selected state is maintained by the liste widget and its model and cannot be set otherwise. .. versionadded:: 4.12 .. method:: set_child(child: ~gi.repository.Gtk.Widget | None = None) -> None 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. .. versionadded:: 4.12 :param child: The list item's child or :const:`None` to unset .. method:: set_focusable(focusable: bool) -> None Sets ``self`` to be focusable. If an item is focusable, it can be focused using the keyboard. This works similar to :obj:`~gi.repository.Gtk.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. .. versionadded:: 4.12 :param focusable: if the item should be focusable Properties ---------- .. rst-class:: interim-class .. class:: ColumnViewCell :no-index: .. attribute:: props.child :type: ~gi.repository.Gtk.Widget Widget used for display. .. versionadded:: 4.12 .. attribute:: props.focusable :type: bool If the item can be focused with the keyboard. .. versionadded:: 4.12 .. attribute:: props.item :type: ~gi.repository.GObject.Object Displayed item. .. versionadded:: 4.12 .. attribute:: props.position :type: int Position of the item. .. versionadded:: 4.12 .. attribute:: props.selected :type: bool If the item is currently selected. .. versionadded:: 4.12