Index

Package: Set_Default_Sort_Func_User_Data (generic)

Description

generic
      type User_Data_Type (<>) is private;
      with procedure Destroy (Data : in out User_Data_Type) is null;
   package Set_Default_Sort_Func_User_Data is

Types

User_Data_Type

type User_Data_Type (<>) is private;

Gtk_Tree_Iter_Compare_Func

type Gtk_Tree_Iter_Compare_Func is access function
        (Model     : Gtk.Tree_Model.Gtk_Tree_Model;
         A         : Gtk.Tree_Model.Gtk_Tree_Iter;
         B         : Gtk.Tree_Model.Gtk_Tree_Iter;
         User_Data : User_Data_Type) return Gint;
A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive integer if A sorts before B, A sorts with B, or A sorts after B respectively. If two iters compare as equal, their order in the sorted model is undefined. In order to ensure that the Gtk.Tree_Sortable.Gtk_Tree_Sortable behaves as expected, the GtkTreeIterCompareFunc must define a partial order on the model, i.e. it must be reflexive, antisymmetric and transitive. For example, if Model is a product catalogue, then a compare function for the "price" column could be one which returns 'price_of(A) - price_of(B)'. "model": The Gtk.Tree_Model.Gtk_Tree_Model the comparison is within "a": A Gtk.Tree_Model.Gtk_Tree_Iter in Model "b": Another Gtk.Tree_Model.Gtk_Tree_Iter in Model "user_data": Data passed when the compare func is assigned e.g. by gtk_tree_sortable_set_sort_func

Subprograms & Entries

Destroy

procedure Destroy 
(Data: in out User_Data_Type) is null;

Set_Default_Sort_Func

procedure Set_Default_Sort_Func 
(Sortable: Gtk.Tree_Sortable.Gtk_Tree_Sortable;
Sort_Func: Gtk_Tree_Iter_Compare_Func;
User_Data: User_Data_Type);
Sets the default comparison function used when sorting to be Sort_Func. If the current sort column id of Sortable is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function. If Sort_Func is null, then there will be no default comparison function. This means that once the model has been sorted, it can't go back to the default state. In this case, when the current sort column id of Sortable is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted. "sort_func": The comparison function "user_data": User data to pass to Sort_Func, or null