Gtk.List_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_List_Box_Filter_Func

type Gtk_List_Box_Filter_Func is access function
  (Row       : not null access Gtk.List_Box_Row.Gtk_List_Box_Row_Record'Class;
   User_Data : User_Data_Type) return Boolean;

Will be called whenever the row changes or is added and lets you control if the row should be visible or not. Since: gtk+ 3.10

Parameters
Row

the row 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.List_Box.Gtk_List_Box_Record'Class;
    Filter_Func : Gtk_List_Box_Filter_Func;
    User_Data   : User_Data_Type)

By setting a filter function on the Box one can decide dynamically which of the rows to show. For instance, to implement a search function on a list that filters the original list to only show the matching rows. The Filter_Func will be called for each row after the call, and it will continue to be called each time a row changes (via Gtk.List_Box_Row.Changed) or when Gtk.List_Box.Invalidate_Filter is called. Note that using a filter function is incompatible with using a model (see Gtk.List_Box.Bind_Model). Since: gtk+ 3.10

Parameters
Self
Filter_Func

callback that lets you filter which rows to show

User_Data

user data passed to Filter_Func

User_Data_Type

type User_Data_Type (<>) is private;