Package: gtk

Function gtk-list-box-bind-model

Lambda List

gtk-list-box-bind-model (listbox model func)

Arguments

listbox -- a gtk-list-box widget
model -- a g-list-model object to be bound to listbox
func -- a gtk-list-box-create-widget-func callback function that creates widgets for items or nil in case you also passed nil as model

Details

Binds a model to the list box. If the list box was already bound to a model, that previous binding is destroyed.

The contents of the list box are cleared and then filled with widgets that represent items from the model. The list box is updated whenever the model changes. If the model argument is nil, the list box is left empty.

It is undefined to add or remove widgets directly, for example, with the gtk-list-box-insert or gtk-container-add functions, while the list box is bound to a model.

Note that using a model is incompatible with the filtering and sorting functionality in the list box. When using a model, filtering and sorting should be implemented by the model.
 

See also

2021-11-16