Basics
Guides
API Reference
Basics
Guides
API Reference
[271:14] static extends: object
Generated metadata helpers for ListStore class surfaces.
properties ()
Returns property metadata for
ListStore.
A list.[15:7] extends: object
GListStore is a simple implementation of [iface@Gio.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.
GListStore (item_type = null)
Creates a new #GListStore with items of type @item_type. @item_type must be a subclass of #GObject.
item_type is the #GType of items in the list.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
GObject.
A GObject object.asListModel ()
Wraps this handle as
GListModel.
A GListModel object.append (object item)
Appends @item to @store. @item must be of type #GListStore:item-type. This function takes a ref on @item. Use g_list_store_splice() to append multiple items at the same time efficiently.
item is the new item.None.find (object item)
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
will not be set, and this method will return %FALSE. If you need to compare the two items with a custom comparison function, use g_list_store_find_with_equal_func() with a custom #GEqualFunc instead.item is an item.position is the first position of @item, if it was found..Whether @store contains @item. If it was found, @position will be set to the position where @item occurred for the first time..find_with_equal_func (object item, object equal_func)
Looks up the given @item in the list store by looping over the items and comparing them with @equal_func until the first occurrence of @item which matches. If @item was not found, then @position will not be set, and this method will return %FALSE. @item is always passed as second parameter to
Since GLib 2.76 it is possible to pass NULL for @item.item is an item.equal_func is A custom equality check function.position is the first position of @item, if it was found..Whether @store contains @item. If it was found, @position will be set to the position where @item occurred for the first time..find_with_equal_func_full (object item, user_data)
Like g_list_store_find_with_equal_func() but with an additional
that is passed to @equal_func. @item is always passed as second parameter to @equal_func. Since GLib 2.76 it is possible to pass NULL for @item.item is an item.equal_func is A custom equality check function.user_data is user data for @equal_func.position is the first position of @item, if it was found..Whether @store contains @item. If it was found, @position will be set to the position where @item occurred for the first time..insert (int position, object 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. This function takes a ref on @item. Use g_list_store_splice() to insert multiple items at the same time efficiently.
position is the position at which to insert the new item.item is the new item.None.insert_sorted (object item, user_data)
Inserts @item into @store at a position to be determined by the
The list must already be sorted before calling this function or the result is undefined. Usually you would approach this by only ever inserting items by way of this function. This function takes a ref on @item.item is the new item.compare_func is pairwise comparison function for sorting.user_data is user data for @compare_func.the position at which @item was inserted.remove (int position)
Removes the item from @store that is at @position. @position must be smaller than the current length of the list. Use g_list_store_splice() to remove multiple items at the same time efficiently.
position is the position of the item that is to be removed.None.remove_all ()
Removes all items from @store.
None.sort (user_data)
Sort the items in @store according to @compare_func.
compare_func is pairwise comparison function for sorting.user_data is user data for @compare_func.None.splice (int position, int n_removals, list additions)
Changes @store by removing @n_removals items and adding @n_additions items to it. @additions must contain @n_additions items of type #GListStore:item-type. %NULL is not permitted. This function is more efficient than g_list_store_insert() and g_list_store_remove(), because it only emits #GListModel::items-changed once for the change. This function takes a ref on each item in @additions. The parameters @position and @n_removals must be correct (ie: @position + @n_removals must be less than or equal to the length of the list at the time this function is called).
position is the position at which to make the change.n_removals is the number of items to remove.additions is the items to add.n_additions is the number of items to add.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.