:right-sidebar: True ListBoxRow =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: ListBoxRow(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Actionable`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` ``GtkListBoxRow`` is the kind of widget that can be added to a ``GtkListBox``. Constructors ------------ .. rst-class:: interim-class .. class:: ListBoxRow :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``GtkListBoxRow``. Methods ------- .. rst-class:: interim-class .. class:: ListBoxRow :no-index: .. method:: changed() -> None Marks ``row`` as changed, causing any state that depends on this to be updated. This affects sorting, filtering and headers. Note that calls to this method must be in sync with the data used for the row functions. For instance, if the list is mirroring some external data set, and *two* rows changed in the external data set then when you call :func:`~gi.repository.Gtk.ListBoxRow.changed` on the first row the sort function must only read the new data for the first of the two changed rows, otherwise the resorting of the rows will be wrong. This generally means that if you don’t fully control the data model you have to duplicate the data that affects the listbox row functions into the row widgets themselves. Another alternative is to call :obj:`~gi.repository.Gtk.ListBox.invalidate_sort` on any model change, but that is more expensive. .. method:: get_activatable() -> bool Gets whether the row is activatable. .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child widget of ``row``. .. method:: get_header() -> ~gi.repository.Gtk.Widget | None Returns the current header of the ``row``. This can be used in a ``Gtk.ListBoxUpdateHeaderFunc`` to see if there is a header set already, and if so to update the state of it. .. method:: get_index() -> int Gets the current index of the ``row`` in its ``GtkListBox`` container. .. method:: get_selectable() -> bool Gets whether the row can be selected. .. method:: is_selected() -> bool Returns whether the child is currently selected in its ``GtkListBox`` container. .. method:: set_activatable(activatable: bool) -> None Set whether the row is activatable. :param activatable: :const:`True` to mark the row as activatable .. method:: set_child(child: ~gi.repository.Gtk.Widget | None = None) -> None Sets the child widget of ``self``. :param child: the child widget .. method:: set_header(header: ~gi.repository.Gtk.Widget | None = None) -> None Sets the current header of the ``row``. This is only allowed to be called from a ``Gtk.ListBoxUpdateHeaderFunc``. It will replace any existing header in the row, and be shown in front of the row in the listbox. :param header: the header .. method:: set_selectable(selectable: bool) -> None Set whether the row can be selected. :param selectable: :const:`True` to mark the row as selectable Properties ---------- .. rst-class:: interim-class .. class:: ListBoxRow :no-index: .. attribute:: props.activatable :type: bool Determines whether the ::row-activated signal will be emitted for this row. .. attribute:: props.child :type: ~gi.repository.Gtk.Widget The child widget. .. attribute:: props.selectable :type: bool Determines whether this row can be selected. Signals ------- .. rst-class:: interim-class .. class:: ListBoxRow.signals :no-index: .. method:: activate() -> None This is a keybinding signal, which will cause this row to be activated. If you want to be notified when the user activates a row (by key or not), use the :obj:`~gi.repository.Gtk.ListBox.signals.row_activated` signal on the row’s parent ``GtkListBox``. Virtual Methods --------------- .. rst-class:: interim-class .. class:: ListBoxRow :no-index: .. method:: do_activate() -> None Fields ------ .. rst-class:: interim-class .. class:: ListBoxRow :no-index: .. attribute:: parent_instance