Method
Gtk ListBoxbind_model
since: 3.16
Declaration [src]
void
gtk_list_box_bind_model(
GtkListBox*box,
GListModel*model,
GtkListBoxCreateWidgetFunccreate_widget_func,
gpointeruser_data,
GDestroyNotifyuser_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_list_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 GtkListBox. When using a model, filtering and sorting should be implemented by the model.
Available since: 3.16
Parameters
model-
Type:
GObjectThe
GListModelto be bound tobox.The argument can beNULL.The data is owned by the caller of the method. create_widget_func-
Type:
GtkListBoxCreateWidgetFuncA function that creates widgets for items or
NULLin case you also passedNULLasmodel.The argument can beNULL. user_data-
Type:
gpointerUser data passed to
create_widget_func.The argument can beNULL.The data is owned by the caller of the method. user_data_free_func-
Type:
Function for freeing
user_data.