It derives from <GObject>.
<GListStore> is a simple implementation of
<GListModel> 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.
The type of items contained in this list store. Items must be
subclasses of <GObject>.
Its value is a class, or a GType number.
It can only be set when the object is made, with #:item-type.
The number of items contained in this list store.
Its value is an unsigned 32-bit integer.
It is read only.
Appends item to self. item must be of type
list-store:item-type.
This function takes a ref on item.
Use list-store:splice to append multiple
items at the same time efficiently.
Passed: a <GListStore>.
Passed: a <GObject>.
the new 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 position will not be set, and this method will return
#f.
If you need to compare the two items with a custom comparison function,
use list-store:find-with-equal-func with a custom
GEqualFunc instead.
Passed: a <GListStore>.
Passed: a <GObject>.
an item
Returned: a boolean.
Whether self contains item. If it was found, position will be set to the position where item occurred for the first time.
Returned: an unsigned 32-bit integer.
the first position of item, if it was found.
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
#f.
item is always passed as second parameter to equal-func.
Since GLib 2.76 it is possible to pass NULL for item.
Passed: a <GListStore>.
Passed: a <GObject>, or #f.
an item
Passed: a procedure.
A custom equality check function
See GEqualFunc for how it is called.
Returned: a boolean.
Whether self contains item. If it was found, position will be set to the position where item occurred for the first time.
Returned: an unsigned 32-bit integer.
the first position of item, if it was found.
Like list-store:find-with-equal-func but with an
additional user-data 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.
Passed: a <GListStore>.
Passed: a <GObject>, or #f.
an item
Passed: a procedure.
A custom equality check function
See GEqualFuncFull for how it is
called.
Returned: a boolean.
Whether self contains item. If it was found, position will be set to the position where item occurred for the first time.
Returned: an unsigned 32-bit integer.
the first position of item, if it was found.
Not passed: guile-gi supplies it.
user data for equal-func
Inserts item into self at position. item must
be of type list-store: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 list-store:splice to insert multiple
items at the same time efficiently.
Passed: a <GListStore>.
Passed: an unsigned 32-bit integer.
the position at which to insert the new item
Passed: a <GObject>.
the new item
Inserts item into self 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 by only ever inserting items by way of this function.
This function takes a ref on item.
Passed: a <GListStore>.
Passed: a <GObject>.
the new item
Passed: a procedure.
pairwise comparison function for sorting
See GCompareDataFunc for how it is
called.
Returned: an unsigned 32-bit integer.
the position at which item was inserted
Not passed: guile-gi supplies it.
user data for compare-func
Creates a new <GListStore> with items of type
item-type. item-type must be a subclass of
<GObject>.
Passed: a class, or a GType number.
the GType of items in the list
Returned: a <GListStore>.
a new <GListStore>
Removes the item from self that is at position. position must be smaller than the current length of the list.
Use list-store:splice to remove multiple
items at the same time efficiently.
Passed: a <GListStore>.
Passed: an unsigned 32-bit integer.
the position of the item that is to be removed
Removes all items from self.
Passed: a <GListStore>.
Sort the items in self according to compare-func.
Passed: a <GListStore>.
Passed: a procedure.
pairwise comparison function for sorting
See GCompareDataFunc for how it is
called.
Not passed: guile-gi supplies it.
user data for compare-func
Changes self by removing n-removals items and adding
n-additions items to it. additions must contain
n-additions items of type list-store:item-type. #f is not permitted.
This function is more efficient than list-store:insert and list-store:remove, because it only emits list-model: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).
Passed: a <GListStore>.
Passed: an unsigned 32-bit integer.
the position at which to make the change
Passed: an unsigned 32-bit integer.
the number of items to remove
Passed: a list or vector, each a <GObject>.
the items to add
Not passed: guile-gi gives the length of additions.
the number of items to add