Class: Gio::ListStore
- Inherits:
-
Object
- Object
- Gio::ListStore
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#append(item) ⇒ nil
Appends item to store.
-
#find(item, position) ⇒ TrueClass
Looks up the given item in the list store by looping over the items until the first occurrence of item.
-
#find_with_equal_func(item, equal_func, position) ⇒ TrueClass
Looks up the given item in the list store by looping over the items and comparing them with compare_func until the first occurrence of item which matches.
-
#insert(position, item) ⇒ nil
Inserts item into store at position.
-
#insert_sorted(item, compare_func, user_data) ⇒ Integer
Inserts item into store at a position to be determined by the compare_func.
-
#item_type ⇒ GLib::Type
The type of items contained in this list store.
-
#item_type=(item_type) ⇒ GLib::Type
The type of items contained in this list store.
-
#new(item_type) ⇒ Gio::ListStore
Creates a new GList::Store with items of type item_type.
-
#remove(position) ⇒ nil
Removes the item from store that is at position.
-
#remove_all ⇒ nil
Removes all items from store.
-
#sort(compare_func, user_data) ⇒ nil
Sort the items in store according to compare_func.
-
#splice(position, n_removals, additions, n_additions) ⇒ nil
Changes store by removing n_removals items and adding n_additions items to it.
Instance Method Details
#append(item) ⇒ nil
Appends item to store. item must be of type GList::Store:item-type.
This function takes a ref on item.
Use g_list_store_splice() to append multiple items at the same time efficiently.
#find(item, position) ⇒ TrueClass
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.
If you need to compare the two items with a custom comparison function, use g_list_store_find_with_equal_func() with a custom GEqual::Func instead. set to the position where item occurred for the first time.
#find_with_equal_func(item, equal_func, position) ⇒ TrueClass
Looks up the given item in the list store by looping over the items and comparing them with compare_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. set to the position where item occurred for the first time.
#insert(position, item) ⇒ nil
Inserts item into store at position. item must be of type GList::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 g_list_store_splice() to insert multiple items at the same time efficiently.
#insert_sorted(item, compare_func, user_data) ⇒ Integer
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 by only ever inserting items by way of this function.
This function takes a ref on item.
#item_type ⇒ GLib::Type
The type of items contained in this list store. Items must be subclasses of #GObject.
#item_type=(item_type) ⇒ GLib::Type
The type of items contained in this list store. Items must be subclasses of #GObject.
#new(item_type) ⇒ Gio::ListStore
Creates a new GList::Store with items of type item_type. item_type must be a subclass of #GObject.
#remove(position) ⇒ nil
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.
#remove_all ⇒ nil
Removes all items from store.
#sort(compare_func, user_data) ⇒ nil
Sort the items in store according to compare_func.
#splice(position, n_removals, additions, n_additions) ⇒ nil
Changes store by removing n_removals items and adding n_additions items to it. additions must contain n_additions items of type GList::Store:item-type. nil is not permitted.
This function is more efficient than g_list_store_insert() and g_list_store_remove(), because it only emits GList::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).