Gtk.List_Box.Set_Header_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_Update_Header_Func

type Gtk_List_Box_Update_Header_Func is access procedure
  (Row       : not null access Gtk.List_Box_Row.Gtk_List_Box_Row_Record'Class;
   Before    : access Gtk.List_Box_Row.Gtk_List_Box_Row_Record'Class;
   User_Data : User_Data_Type);

Whenever Row changes or which row is before Row changes this is called, which lets you update the header on Row. You may remove or set a new one via gtk_list_box_row_set_header or just change the state of the current header widget. Since: gtk+ 3.10

Parameters
Row

the row to update

Before

the row before Row, or null if it is first

User_Data

user data

Set_Header_Func

procedure Set_Header_Func
   (Self          : not null access Gtk.List_Box.Gtk_List_Box_Record'Class;
    Update_Header : Gtk_List_Box_Update_Header_Func;
    User_Data     : User_Data_Type)

By setting a header function on the Box one can dynamically add headers in front of rows, depending on the contents of the row and its position in the list. For instance, one could use it to add headers in front of the first item of a new kind, in a list sorted by the kind. The Update_Header can look at the current header widget using Gtk.List_Box_Row.Get_Header and either update the state of the widget as needed, or set a new one using Gtk.List_Box_Row.Set_Header. If no header is needed, set the header to null. Note that you may get many calls Update_Header to this for a particular row when e.g. changing things that don't affect the header. In this case it is important for performance to not blindly replace an existing header with an identical one. The Update_Header function 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) and when the row before changes (either by Gtk.List_Box_Row.Changed on the previous row, or when the previous row becomes a different row). It is also called for all rows when Gtk.List_Box.Invalidate_Headers is called. Since: gtk+ 3.10

Parameters
Self
Update_Header

callback that lets you add row headers

User_Data

user data passed to Update_Header

User_Data_Type

type User_Data_Type (<>) is private;