IupReparent

Definition: include pGUI.e

integer err = IupReparent(Ihandle child, Ihandle new_parent, Ihandln ref_child)
Description: Moves an interface element from one position in the hierarchy tree to another.

child: Identifier of the element to be moved.
new_parent: Identifier of the new parent.
ref_child: Identifier of the element to be used as reference, where the child will be inserted before it. Can be NULL.

Both new_parent and child must be mapped or unmapped at the same time.

If ref_child is NULL, then it will append the child to the new_parent.
If ref_child is NOT NULL then it will insert child before ref_child inside the new_parent.

Returns IUP_NOERROR if successful, IUP_ERROR on failure.
Notes: This function is faster and easier than doing the sequence unmap, detach, append/insert and map.

The elements are NOT immediately repositioned.
Call IupRefresh for the container (or any other element in the dialog) to update the dialog layout.

Motif does not support the re-parent function, but we simulate a re-parent doing a unmap/map sequence.
But some attributes may be lost during the operation, mostly attributes that are id dependent.
See Also: IupAppend, IupInsert, IupDetach, IupMap, IupUnmap, IupRefresh