IupPopup

IUP - Portable User Interface

IupPopup

Shows a dialog or menu and restricts user interaction only to the specified element. This function will only return the control to the application after a callback returns IUP_CLOSE or when the popup dialog is hidden, for exemple using IupHide.

Parameters/Return

int IupPopup(Ihandle *element, int x, int y); [in C]
IupPopup(element: iuplua_tag, x, y: number) -> (ret: number) [in IupLua3]
iup.Popup(element: iuplua_tag, x, y: number) -> (ret: number) [in IupLua5]
or element:popup(x, y: number) -> (ret: number) [in IupLua]

element: Identifier of a dialog or a menu.
x: x coordinate of the left corner of the interface element. The following macros are valid:

  • IUP_LEFT: Positions the element on the left corner of the screen
  • IUP_CENTER: Centers the element on the screen
  • IUP_RIGHT: Positions the element on the right corner of the screen
  • IUP_MOUSEPOS: Positions the element on the mouse cursor

y: y coordinate of the upper part of the interface element. The following macros are valid:

  • IUP_TOP: Positions the element on the top of the screen
  • IUP_CENTER: Vertically centers the element on the screen
  • IUP_BOTTOM: Positions the element on the base of the screen
  • IUP_MOUSEPOS: Positions the element on the mouse cursor

This function returns IUP_ERROR if the element could not be created.

Notes

When a popup dialog is interacting with the user, another dialog can only be opened by means of the IupPopup function – never with IupShow or IupShowXY.

This function can be executed more than once for the same dialog. In fact, it works just like functions IupShow and IupShowXY, but it inhibits interaction with other dialogs. Therefore, it does not destroy the dialog’s elements when it ends. To destroy the elements, function IupDestroy must be called.

See Also

IupShowXY, IupShow, IupHide.