bind_model


Description:

[ Version ( since = "1.24" ) ]
public void bind_model (ListModel? model, owned ActorCreateChildFunc create_child_func)

Binds a ListModel to a Actor.

If the Actor was already bound to a ListModel, the previous binding is destroyed.

The existing children of Actor are destroyed when setting a model, and new children are created and added, representing the contents of the model. The Actor is updated whenever the model changes. If model is null, the Actor is left empty.

When a Actor is bound to a model, adding and removing children directly is undefined behaviour.

Parameters:

this

a Actor

model

a ListModel

create_child_func

a function that creates Actor instances from the contents of the model

notify

function called when unsetting the model

user_data

user data passed to create_child_func