Shows a dialog or menu and restricts user interaction only to the specified element. It is equivalent of creating a Modal dialog is some toolkits.
If another dialog is shown after IupPopup using IupShow, then its interaction will not be inhibited. Every IupPopup call creates a new popup level that inhibits all previous dialogs interactions, but does not disable new ones. IMPORTANT: The popup levels must be closed in the reverse order they were created or unpredictable results will occur.
For a dialog this function will only return the control to the application after a callback returns IUP_CLOSE, IupExitLoop is called, or when the popup dialog is hidden, for example using IupHide. For a menu it returns automatically after a menu item is selected. IMPORTANT: If a menu item callback returns IUP_CLOSE, it will ends the current popup level dialog.
int IupPopup(Ihandle *ih, int x, int y); [in C] iup.Popup(ih: ihandle[, x, y: number]) -> (ret: number) [in Lua] or ih:popup([x, y: number]) -> (ret: number) [in Lua]
ih: Identifier of a dialog or a menu.
x: horizontal position of the top left corner of the window or menu, relative to the origin of the
main screen.
The following definitions can also be used:
y: vertical position of the top left corner of the window or menu, relative to the origin of the main screen. The following definitions can also be used:
Returns: IUP_NOERROR if successful. Returns IUP_INVALID if not a dialog or menu. If there was an error returns IUP_ERROR..
Will call IupMap for the element.
x and y positions are the same as returned by the SCREENPOSITION attribute.
See the PLACEMENT attribute for other position and show options.
When IUP_CENTERPARENT is used but PARENTDIALOG is not defined then it is replaced by IUP_CENTER.
When IUP_CURRENT is used at the first time the dialog is shown then it will be replaced by IUP_CENTERPARENT.
The main screen size does not include additional monitors.
IupPopup works just like IupShow and IupShowXY, but it inhibits interaction with other dialogs and interrupts the processing until IUP_CLOSE is returned in a callback or the dialog is hidden. Althougth it interrupts the processing, it does not destroy the dialog when it ends. To destroy the dialog, IupDestroy must be called.
IMPORTANT: Calling IupPopup for an already visible dialog will only update its position and/or size on screen, will NOT change its modal state and will NOT interrupt processing.
In GTK and Motif the inactive dialogs will still be able to move, resize and change their Z-order. Although their contents will be inactive, keyboard will be disabled, and they can not be closed from the close box.