Gtk.Flow_Box.Set_Filter_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_Filter_Func

type Gtk_Flow_Box_Filter_Func is access function
  (Child     : not null access Gtk.Flow_Box_Child.Gtk_Flow_Box_Child_Record'Class;
   User_Data : User_Data_Type) return Boolean;

A function that will be called whenrever a child changes or is added. It lets you control if the child should be visible or not. Since: gtk+ 3.12

Parameters
Child

a Gtk.Flow_Box_Child.Gtk_Flow_Box_Child that may be filtered

User_Data

user data

Return Value

True if the row should be visible, False otherwise

Set_Filter_Func

procedure Set_Filter_Func
   (Self        : not null access Gtk.Flow_Box.Gtk_Flow_Box_Record'Class;
    Filter_Func : Gtk_Flow_Box_Filter_Func;
    User_Data   : User_Data_Type)

By setting a filter function on the Box one can decide dynamically which of the children to show. For instance, to implement a search function that only shows the children matching the search terms. The Filter_Func will be called for each child after the call, and it will continue to be called each time a child changes (via Gtk.Flow_Box_Child.Changed) or when Gtk.Flow_Box.Invalidate_Filter is called. Note that using a filter function is incompatible with using a model (see Gtk.Flow_Box.Bind_Model). Since: gtk+ 3.12

Parameters
Self
Filter_Func

callback that lets you filter which children to show

User_Data

user data passed to Filter_Func

User_Data_Type

type User_Data_Type (<>) is private;