bindModel

open fun bindModel(model: <Error class: unknown class>? = null, createWidgetFunc: ListBoxCreateWidgetFunc?)

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 method@Gtk.ListBox.insert) 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.

Parameters

model

the GListModel to be bound to @box

createWidgetFunc

a function that creates widgets for items or null in case you also passed null as @model