reparent


Description:

[ Version ( deprecated = true , deprecated_since = "1.10" , since = "0.2" ) ]
public void reparent (Actor new_parent)

Warning: reparent is deprecated since 1.10.

Resets the parent actor of this.

Note:

Use remove_child and add_child instead; remember to take a reference on the actor being removed before calling remove_child to avoid the reference count dropping to zero and the actor being destroyed.

This function is logically equivalent to calling unparent and set_parent, but more efficiently implemented, as it ensures the child is not finalized when unparented, and emits the parent_set signal only once.

In reality, calling this function is less useful than it sounds, as some application code may rely on changes in the intermediate state between removal and addition of the actor from its old parent to the new_parent. Thus, it is strongly encouraged to avoid using this function in application code.

Parameters:

this

a Actor

new_parent

the new Actor parent