Gtk.Flow_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_Flow_Box_Sort_Func

type Gtk_Flow_Box_Sort_Func is access function
  (Child1    : not null access Gtk.Flow_Box_Child.Gtk_Flow_Box_Child_Record'Class;
   Child2    : not null access Gtk.Flow_Box_Child.Gtk_Flow_Box_Child_Record'Class;
   User_Data : User_Data_Type) return Glib.Gint;

A function to compare two children to determine which should come first. Since: gtk+ 3.12

Parameters
Child1

the first child

Child2

the second child

User_Data

user data

Return Value

< 0 if Child1 should be before Child2, 0 if the are equal, and > 0 otherwise

Set_Sort_Func

procedure Set_Sort_Func
   (Self      : not null access Gtk.Flow_Box.Gtk_Flow_Box_Record'Class;
    Sort_Func : Gtk_Flow_Box_Sort_Func;
    User_Data : User_Data_Type)

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

Parameters
Self
Sort_Func

the sort function

User_Data

user data passed to Sort_Func

User_Data_Type

type User_Data_Type (<>) is private;