Method

Gtk.FlowBox.bind_model

Declaration [src]

void
gtk_flow_box_bind_model (
  GtkFlowBox* box,
  GListModel* model,
  GtkFlowBoxCreateWidgetFunc create_widget_func,
  gpointer user_data,
  GDestroyNotify user_data_free_func
)

Description [src]

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()) 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.

Parameters

model GListModel*
 

the GListModel to be bound to box

 Can be NULL
 Ownership is not transferred to the callee
create_widget_func GtkFlowBoxCreateWidgetFunc
 

a function that creates widgets for items

user_data gpointer
 

user data passed to create_widget_func

user_data_free_func GDestroyNotify
 

function for freeing user_data