Gtk.List_Box.Set_Sort_Func_User_Data

Entities

Generic formal parameters

Access Types

Subprograms

Description

Destroy

procedure Destroy (Data : in out User_Data_Type)
Parameters
Data

Gtk_List_Box_Sort_Func

type Gtk_List_Box_Sort_Func is access function
  (Row1      : not null access Gtk.List_Box_Row.Gtk_List_Box_Row_Record'Class;
   Row2      : not null access Gtk.List_Box_Row.Gtk_List_Box_Row_Record'Class;
   User_Data : User_Data_Type) return Glib.Gint;

Compare two rows to determine which should be first. Since: gtk+ 3.10

Parameters
Row1

the first row

Row2

the second row

User_Data

user data

Return Value

< 0 if Row1 should be before Row2, 0 if they are equal and > 0 otherwise

Set_Sort_Func

procedure Set_Sort_Func
   (Self      : not null access Gtk.List_Box.Gtk_List_Box_Record'Class;
    Sort_Func : Gtk_List_Box_Sort_Func;
    User_Data : User_Data_Type)

By setting a sort function on the Box one can dynamically reorder the rows of the list, based on the contents of the rows. The Sort_Func will be called for each row after the call, and will continue to be called each time a row changes (via Gtk.List_Box_Row.Changed) and when Gtk.List_Box.Invalidate_Sort is called. Note that using a sort function is incompatible with using a model (see Gtk.List_Box.Bind_Model). Since: gtk+ 3.10

Parameters
Self
Sort_Func

the sort function

User_Data

user data passed to Sort_Func

User_Data_Type

type User_Data_Type (<>) is private;