gobj_change_parent()

gobj_change_parent()#

Changes the parent of the given hgobj instance to a new parent hgobj. The function updates the internal hierarchy of the object tree.

Prototype

int gobj_change_parent(
    hgobj gobj,
    hgobj gobj_new_parent
);

Parameters

Key

Type

Description

gobj

hgobj

The hgobj instance whose parent is to be changed.

gobj_new_parent

hgobj

The new parent hgobj instance.


Return Value

Returns 0 on success, or -1 if an error occurs (e.g., if gobj or gobj_new_parent is NULL).

Notes

This function ensures that the object hierarchy remains consistent when changing parents. It is useful for dynamically restructuring the object tree.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples