Interface

Gio-2.0GioListModelInterface

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

interface Interface<A extends GObject.Object = GObject.Object> {
    vfunc_get_item(position: number): A;
    vfunc_get_item_type(): GType;
    vfunc_get_n_items(): number;
}

Type Parameters

Hierarchy (View Summary)

Index

Methods

  • 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 A

  • 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