Method

GioListStoreinsert_sorted

Declaration

guint
g_list_store_insert_sorted (
  GListStore* store,
  GObject* item,
  GCompareDataFunc compare_func,
  gpointer user_data
)

Description

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.

Available since:2.44

Parameters

item GObject
 

The new item.

 The data is owned by the caller of the function.
compare_func GCompareDataFunc
 

Pairwise comparison function for sorting.

user_data gpointer
 

User data for compare_func.

 The argument can be NULL.
 The data is owned by the caller of the function.

Return value

Returns: guint
 

The position at which item was inserted.