Interface

Gtk-4.0GtkSectionModelInterface

Interface for implementing SectionModel. Contains only the virtual methods that need to be implemented.

interface Interface<A extends GObject.Object = GObject.Object> {
    vfunc_get_item(position: number): GObject.Object | null;
    vfunc_get_item_type(): GType;
    vfunc_get_n_items(): number;
    vfunc_get_section(position: number): [number, number];
}

Type Parameters

Hierarchy (View Summary)

Index

Methods

Methods - Inherited from Gio.ListModel.Interface

Methods

  • Query the section that covers the given position. The number of items in the section can be computed by out_end - out_start.

    If the position is larger than the number of items, a single range from n_items to G_MAXUINT will be returned.

    Parameters

    • position: number

      the position of the item to query

    Returns [number, number]

Methods - Inherited from Gio.ListModel.Interface

  • Get the item at position. If position is greater than the number of items in list, null is returned.

    null is never returned for an index that is smaller than the length of the list. See g_list_model_get_n_items().

    The same GObject.Object instance may not appear more than once in a Gio.ListModel.

    Parameters

    • position: number

      the position of the item to fetch

    Returns GObject.Object | null

  • Gets the type of the items in list.

    All items returned from g_list_model_get_item() are of the type returned by this function, or a subtype, or if the type is an interface, they are an implementation of that interface.

    The item type of a Gio.ListModel can not change during the life of the model.

    Returns GType

  • Gets the number of items in list.

    Depending on the model implementation, calling this function may be less efficient than iterating the list with increasing values for position until g_list_model_get_item() returns null.

    Returns number