IupMap
Creates (maps) the native interface objects corresponding to the given IUP interface elements.
It also recursively creates the native elements of all the children in the element's tree.
The element must be already attached to a mapped container, except the dialog. A child can only be mapped if its parent is already mapped.
This function is automatically called before the dialog is shown in IupShow, IupShowXY or IupPopup.
Parameters/Return
int IupMap(Ihandle* ih);
ih: Identifier of an interface element.
Returns: IUP_NOERROR if successful. If the element was already mapped returns IUP_NOERROR. If the native creation failed, returns IUP_ERROR.
Notes
If the element is a dialog, then the abstract layout will be updated even if the dialog is already mapped. If the dialog is visible, the elements will be immediately repositioned. Calling IupMap for an already mapped dialog is the same as only calling IupRefresh for the dialog.
Calling IupMap for an already mapped element that is not a dialog does nothing.
When new elements are added to an already mapped dialog, IupMap must be called for those elements. Then IupRefresh must be called to update the dialog layout.
If the WID attribute of an element is NULL, the element is not mapped yet. Some containers do not have a native element associated, like VBOX and HBOX. In this case, their WID is a fake value (void*)(-1).
Calling IupMap is useful when the value of the WID attribute must be known, i.e., the native element must exist, before a dialog is made visible.
The MAP_CB callback is called at the end of the IupMap function, after all processing, so it can also be used to create other things that depend on the WID attribute. For non-dialog elements it is called before the dialog layout has been updated, so the element current size will still be 0x0.
See Also
IupAppend, IupDetach, IupUnmap, IupCreate, IupDestroy, IupShowXY, IupShow, IupPopup, MAP_CB