Gtk.Tree_Sortable.Gtk_Tree_Sortable is an interface to be implemented by tree models which support sorting. The Gtk.Tree_View.Gtk_Tree_View uses the methods provided by this interface to sort the model.
function "+" (W : Gtk_Tree_Sortable) return Gtk_Tree_Sortable
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Tree_Sortable_Void is not null access procedure (Self : Gtk_Tree_Sortable);
Default_Sort_Column_Id : constant Gint := -1;
Two special values for the sort column
procedure Get_Sort_Column_Id
(Sortable : Gtk_Tree_Sortable;
Sort_Column_Id : out Glib.Gint;
Order : out Gtk.Enums.Gtk_Sort_Type)
Fills in Sort_Column_Id and Order with the current sort column and the order. It returns True unless the Sort_Column_Id is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
The sort column id to be filled in
The Gtk.Enums.Gtk_Sort_Type to be filled in
function Get_Type return Glib.GType
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) return Glib.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).
The Gtk.Tree_Model.Gtk_Tree_Model the comparison is within
A Gtk.Tree_Model.Gtk_Tree_Iter in Model
Another Gtk.Tree_Model.Gtk_Tree_Iter in Model
a negative integer, zero or a positive integer depending on whether A sorts before, with or after B
type Gtk_Tree_Sortable is new Glib.Types.GType_Interface;
function Has_Default_Sort_Func
(Sortable : Gtk_Tree_Sortable) return Boolean
Returns True if the model has a default sort function. This is used primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.
True, if the model has a default sort function
Null_Gtk_Tree_Sortable : constant Gtk_Tree_Sortable;
procedure On_Sort_Column_Changed
(Self : Gtk_Tree_Sortable;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
The ::sort-column-changed signal is emitted when the sort column or sort order of Sortable is changed. The signal is emitted before the contents of Sortable are resorted.
procedure On_Sort_Column_Changed
(Self : Gtk_Tree_Sortable;
Call : Cb_Gtk_Tree_Sortable_Void;
After : Boolean := False)
The ::sort-column-changed signal is emitted when the sort column or sort order of Sortable is changed. The signal is emitted before the contents of Sortable are resorted.
procedure Set_Default_Sort_Func
(Sortable : Gtk_Tree_Sortable;
Sort_Func : Gtk_Tree_Iter_Compare_Func)
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.
The comparison function
procedure Set_Get_Sort_Column_Id
(Self : Tree_Sortable_Interface_Descr;
Handler : Virtual_Get_Sort_Column_Id)
procedure Set_Has_Default_Sort_Func
(Self : Tree_Sortable_Interface_Descr;
Handler : Virtual_Has_Default_Sort_Func)
procedure Set_Set_Default_Sort_Func
(Self : Tree_Sortable_Interface_Descr;
Handler : Virtual_Set_Default_Sort_Func)
procedure Set_Set_Sort_Column_Id
(Self : Tree_Sortable_Interface_Descr;
Handler : Virtual_Set_Sort_Column_Id)
procedure Set_Set_Sort_Func
(Self : Tree_Sortable_Interface_Descr;
Handler : Virtual_Set_Sort_Func)
procedure Set_Sort_Column_Changed
(Self : Tree_Sortable_Interface_Descr;
Handler : Virtual_Sort_Column_Changed)
See Glib.Object.Add_Interface
procedure Set_Sort_Column_Id
(Sortable : Gtk_Tree_Sortable;
Sort_Column_Id : Glib.Gint;
Order : Gtk.Enums.Gtk_Sort_Type)
Sets the current sort column to be Sort_Column_Id. The Sortable will resort itself to reflect this change, after emitting a Gtk.Tree_Sortable.Gtk_Tree_Sortable::sort-column-changed signal. Sort_Column_Id may either be a regular column id, or one of the following special values:
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
will be used, if it is set
GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
the sort column id to set
The sort order of the column
procedure Set_Sort_Func
(Sortable : Gtk_Tree_Sortable;
Sort_Column_Id : Glib.Gint;
Sort_Func : Gtk_Tree_Iter_Compare_Func)
Sets the comparison function used when sorting to be Sort_Func. If the current sort column id of Sortable is the same as Sort_Column_Id, then the model will sort using this function.
the sort column id to set the function for
The comparison function
Signal_Sort_Column_Changed : constant Glib.Signal_Name := "sort-column-changed";
The ::sort-column-changed signal is emitted when the sort column or sort order of Sortable is changed. The signal is emitted before the contents of Sortable are resorted.
procedure Sort_Column_Changed (Sortable : Gtk_Tree_Sortable)
Emits a Gtk.Tree_Sortable.Gtk_Tree_Sortable::sort-column-changed signal on Sortable.
subtype Tree_Sortable_Interface_Descr is Glib.Object.Interface_Description;
Unsorted_Sort_Column_Id : constant Gint := -2;
Two special values for the sort column
type Virtual_Get_Sort_Column_Id is access function
(Sortable : Gtk_Tree_Sortable;
Sort_Column_Id : access Glib.Gint;
Order : access Gtk.Enums.Gtk_Sort_Type) return Glib.Gboolean;
Fills in Sort_Column_Id and Order with the current sort column and the order. It returns True unless the Sort_Column_Id is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
The sort column id to be filled in
The Gtk.Enums.Gtk_Sort_Type to be filled in
True if the sort column is not one of the special sort column ids.
type Virtual_Has_Default_Sort_Func is access function (Sortable : Gtk_Tree_Sortable) return Glib.Gboolean;
Returns True if the model has a default sort function. This is used primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.
True, if the model has a default sort function
type Virtual_Set_Default_Sort_Func is access procedure
(Sortable : Gtk_Tree_Sortable;
Sort_Func : System.Address;
User_Data : System.Address;
Destroy : Glib.G_Destroy_Notify_Address);
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.
The comparison function
User data to pass to Sort_Func, or null
Destroy notifier of User_Data, or null
type Virtual_Set_Sort_Column_Id is access procedure
(Sortable : Gtk_Tree_Sortable;
Sort_Column_Id : Glib.Gint;
Order : Gtk.Enums.Gtk_Sort_Type);
Sets the current sort column to be Sort_Column_Id. The Sortable will resort itself to reflect this change, after emitting a Gtk.Tree_Sortable.Gtk_Tree_Sortable::sort-column-changed signal. Sort_Column_Id may either be a regular column id, or one of the following special values:
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
will be used, if it is set
GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
the sort column id to set
The sort order of the column
type Virtual_Set_Sort_Func is access procedure
(Sortable : Gtk_Tree_Sortable;
Sort_Column_Id : Glib.Gint;
Sort_Func : System.Address;
User_Data : System.Address;
Destroy : Glib.G_Destroy_Notify_Address);
Sets the comparison function used when sorting to be Sort_Func. If the current sort column id of Sortable is the same as Sort_Column_Id, then the model will sort using this function.
the sort column id to set the function for
The comparison function
User data to pass to Sort_Func, or null
Destroy notifier of User_Data, or null
type Virtual_Sort_Column_Changed is access procedure (Sortable : Gtk_Tree_Sortable);
Emits a Gtk.Tree_Sortable.Gtk_Tree_Sortable::sort-column-changed signal on Sortable.