gio.list_store

Module for [ListStore] class

Types 3

[gio.list_store.ListStore] is a simple implementation of [gio.list_model.ListModel] that stores all items in memory.

It provides insertions, deletions, and lookups in logarithmic time with a fast path for the common case of iterating the list linearly.

Methods
GType _gType() @property
ListStore self()Returns `this`, for use in `with` statements.
ListStoreGidBuilder builder()Get builder for [gio.list_store.ListStore] Returns: New builder object
gobject.types.GType itemType() @propertyGet `itemType` property. Returns: The type of items contained in this list store. Items must be subclasses of #GObject.
uint nItems() @propertyGet `nItems` property. Returns: The number of items contained in this list store.
bool findWithEqualFunc(gobject.object.ObjectWrap item, bool delegate(gobject.object.ObjectWrap, gobject.object.ObjectWrap) equalFunc, out uint position)Looks up the given item in the list store by looping over the items and comparing them with equalfunc until the first occurrence of item which matches. If item was not found, then position will not...
uint insertSorted(gobject.object.ObjectWrap item, int delegate(gobject.object.ObjectWrap, gobject.object.ObjectWrap) compareFunc)Inserts item into store at a position to be determined by the compare_func. The list must already be sorted before calling this function or the result is undefined. Usually you would approach this...
void sort(int delegate(gobject.object.ObjectWrap, gobject.object.ObjectWrap) compareFunc)Sort the items in store according to compare_func. Params: compareFunc = pairwise comparison function for sorting
void append(gobject.object.ObjectWrap item)Appends item to store. item must be of type #GListStore:item-type.
bool find(gobject.object.ObjectWrap item, out uint position)Looks up the given item in the list store by looping over the items until the first occurrence of item. If item was not found, then position will not be set, and this method will return false.
void insert(uint position, gobject.object.ObjectWrap item)Inserts item into store at position. item must be of type #GListStore:item-type or derived from it. position must be smaller than the length of the list, or equal to it to append.
void remove(uint position)Removes the item from store that is at position. position must be smaller than the current length of the list.
void removeAll()Removes all items from store.
void splice(uint position, uint nRemovals, gobject.object.ObjectWrap[] additions)Changes store by removing nremovals items and adding nadditions items to it. additions must contain n_additions items of type #GListStore:item-type. null is not permitted.
Constructors
this(void * ptr, Flag!"Take" take)
this(gobject.types.GType itemType)Creates a new #GListStore with items of type itemtype. itemtype must be a subclass of #GObject.
Methods
T itemType(gobject.types.GType propval)Set `itemType` property. Params: propval = The type of items contained in this list store. Items must be subclasses of #GObject. Returns: Builder instance for fluent chaining

Fluent builder for [gio.list_store.ListStore]

Methods