ListHeader

Added in version 4.12.

class ListHeader(**properties: Any)

Superclasses: Object

GtkListHeader is used by list widgets to represent the headers they display.

GtkListHeader objects are managed just like ListItem objects via their factory, but provide a different set of properties suitable for managing the header instead of individual items.

Methods

class ListHeader
get_child() Widget | None

Gets the child previously set via set_child() or None if none was set.

Added in version 4.12.

get_end() int

Gets the end position in the model of the section that self is currently the header for.

If self is unbound, INVALID_LIST_POSITION is returned.

Added in version 4.12.

get_item() Object | None

Gets the model item at the start of the section. This is the item that occupies the list model at position start.

If self is unbound, this function returns None.

Added in version 4.12.

get_n_items() int

Gets the the number of items in the section.

If self is unbound, 0 is returned.

Added in version 4.12.

get_start() int

Gets the start position in the model of the section that self is currently the header for.

If self is unbound, INVALID_LIST_POSITION is returned.

Added in version 4.12.

set_child(child: 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.

Added in version 4.12.

Parameters:

child – The list item’s child or None to unset

Properties

class ListHeader
props.child: Widget

Widget used for display.

Added in version 4.12.

props.end: int

The first position no longer part of this section.

Added in version 4.12.

props.item: Object

The item at the start of the section.

Added in version 4.12.

props.n_items: int

Number of items in this section.

Added in version 4.12.

props.start: int

First position of items in this section.

Added in version 4.12.