# IupMap

Definition: | include pGUI.e IupMap(Ihandle ih)
Description: | Creates (maps) the native interface objects corresponding to the given IUP interface elements. It will also called recursively to create the native element 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. ih: Identifier of an interface element.
pwa/p2js: | Supported.
Notes: | Many applications do not need to invoke IupMap explicitly; it will be performed automatically as needed. It is useful for the application to call IupMap when the value of the WID attribute must be known, i.e. the native element must exist, before a dialog is made visible. [PL: one case where this appears to be needed is before populating an IupTree] If you add new elements to an already mapped dialog you must call IupMap for those elements, and then call IupRefresh to update the dialog layout. If the WID attribute of an element is NULL, it means the element was not already mapped. Some containers do not have a native element associated, like VBOX and HBOX, in this case their WID is the fake value (void*)(-1). 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. 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. But notice that for non dialog elements it will be called before the dialog layout has been updated, so the element current size will still be 0x0 (since 3.14).
See Also: | IupAppend, IupDetach, IupUnmap, IupCreate, IupDestroy, IupShowXY, IupShow, IupPopup, MAP_CB