Gtk.Flow_Box.Bind_Model_User_Data

Entities

Generic formal parameters

Access Types

Subprograms

Description

Bind_Model

procedure Bind_Model
   (Self                : not null access Gtk.Flow_Box.Gtk_Flow_Box_Record'Class;
    Model               : Glib.List_Model.Glist_Model;
    Create_Widget_Func  : Gtk_Flow_Box_Create_Widget_Func;
    User_Data           : User_Data_Type;
    User_Data_Free_Func : Glib.G_Destroy_Notify_Address)

Binds Model to Box. If Box was already bound to a model, that previous binding is destroyed. The contents of Box are cleared and then filled with widgets that represent items from Model. Box is updated whenever Model changes. If Model is null, Box is left empty. It is undefined to add or remove widgets directly (for example, with Gtk.Flow_Box.Insert or Gtk.Container.Add) while Box is bound to a model. Note that using a model is incompatible with the filtering and sorting functionality in GtkFlowBox. When using a model, filtering and sorting should be implemented by the model. Since: gtk+ 3.18

Parameters
Self
Model

the Glib.List_Model.Glist_Model to be bound to Box

Create_Widget_Func

a function that creates widgets for items

User_Data

user data passed to Create_Widget_Func

User_Data_Free_Func

function for freeing User_Data

Destroy

procedure Destroy (Data : in out User_Data_Type)
Parameters
Data

Gtk_Flow_Box_Create_Widget_Func

type Gtk_Flow_Box_Create_Widget_Func is access function
  (Item      : System.Address;
   User_Data : User_Data_Type) return Gtk.Widget.Gtk_Widget;

Called for flow boxes that are bound to a Glib.List_Model.Glist_Model with Gtk.Flow_Box.Bind_Model for each item that gets added to the model. Since: gtk+ 3.18

Parameters
Item

the item from the model for which to create a widget for

User_Data

user data from Gtk.Flow_Box.Bind_Model

Return Value

a Gtk.Widget.Gtk_Widget that represents Item

User_Data_Type

type User_Data_Type (<>) is private;