:right-sidebar: True ListHeader =================================================================== .. currentmodule:: gi.repository.Gtk .. versionadded:: 4.12 .. class:: ListHeader(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` ``GtkListHeader`` is used by list widgets to represent the headers they display. ``GtkListHeader`` objects are managed just like :obj:`~gi.repository.Gtk.ListItem` objects via their factory, but provide a different set of properties suitable for managing the header instead of individual items. Methods ------- .. rst-class:: interim-class .. class:: ListHeader :no-index: .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child previously set via :func:`~gi.repository.Gtk.ListHeader.set_child` or :const:`None` if none was set. .. versionadded:: 4.12 .. method:: get_end() -> int Gets the end position in the model of the section that ``self`` is currently the header for. If ``self`` is unbound, :const:`~gi.repository.Gtk.INVALID_LIST_POSITION` is returned. .. versionadded:: 4.12 .. method:: get_item() -> ~gi.repository.GObject.Object | None Gets the model item at the start of the section. This is the item that occupies the list model at position :obj:`~gi.repository.Gtk.ListHeader.props.start`. If ``self`` is unbound, this function returns :const:`None`. .. versionadded:: 4.12 .. method:: get_n_items() -> int Gets the the number of items in the section. If ``self`` is unbound, 0 is returned. .. versionadded:: 4.12 .. method:: get_start() -> int Gets the start position in the model of the section that ``self`` is currently the header for. If ``self`` is unbound, :const:`~gi.repository.Gtk.INVALID_LIST_POSITION` is returned. .. 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 header 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 Properties ---------- .. rst-class:: interim-class .. class:: ListHeader :no-index: .. attribute:: props.child :type: ~gi.repository.Gtk.Widget Widget used for display. .. versionadded:: 4.12 .. attribute:: props.end :type: int The first position no longer part of this section. .. versionadded:: 4.12 .. attribute:: props.item :type: ~gi.repository.GObject.Object The item at the start of the section. .. versionadded:: 4.12 .. attribute:: props.n_items :type: int Number of items in this section. .. versionadded:: 4.12 .. attribute:: props.start :type: int First position of items in this section. .. versionadded:: 4.12