IupMenu
Definition: |
include pGUI.e
Ihandle ih = IupMenu(Ihandles children={}, string attributes="", dword_seq args={}) |
Description: |
Creates a menu element, which groups 3 types of interface elements: item, submenu and separator. Any other interface element defined inside a menu will be an error.
children: List of identifiers that will be grouped by the menu. It can be empty. For more information on the attributes and args parameters see IupSetAttributes. Returns: the identifier of the created element. |
pwa/p2js: | Supported, but see +x? markers on individual attributes and callbacks. |
See Also: | IupDialog, IupMenuItem, IupSeparator, IupSubmenu, IupPopup, IupDestroy |
Notes: |
A menu can be a menu bar of a dialog, defined by the dialog’s MENU attribute, or a popup menu.
A popup menu is displayed for the user using the IupPopup function (usually on the mouse position) and disappears when an item is selected. IupDestroy should be called only for popup menus. Menu bars associated with dialogs are automatically destroyed when the dialog is destroyed. But if you change the menu of a dialog for another menu, the previous one should be destroyed using IupDestroy. If you replace a menu bar of a dialog, the previous menu is unmapped. Any item inside a menu bar can retrieve attributes from the dialog using IupGetAttribute. It is not necessary to call IupGetDialog. The menu can be created with no elements and filled dynamically using IupAppend() or IupInsert(). The IupMenuItem check is affected by the RADIO attribute in IupMenu When translating C code, note that internally Phix only uses the C function IupMenuv, which accepts a single null-terminated list, and does not use the variable-parameter C IupMenu function. It is perfectly legal (in Phix) to specify an empty list ({}) for the children parameter, but not NULL, and further any list supplied automatically has a NULL terminator added, so you don’t have to. Some examples can be seen in demo\pGUI\sample.exw |
Attributes: | |
BGCOLOR? | the background color of the menu, affects all items in the menu. (since 3.0) |
POPUPALIGN? |
(non inheritable) alignment of the popup menu relative to the given point in the format "horiz_align:vert_align". Where horiz_align can be: ALEFT, ACENTER or ARIGHT; and vert_align can be ATOP, ACENTER or ABOTTOM. Default: ALEFT:ATOP. (since 3.28) |
RADIO? | (non inheritable) enables the automatic toggle of one child item. When a child item is selected the other item is automatically deselected. The menu acts like a IupRadio for its children. Submenus and their children are not affected. |
WID? | (non inheritable) In Windows, returns the HMENU of the menu. |
Callbacks: | |
OPEN_CB | Called just before the menu is opened. |
MENUCLOSE_CB | Called just after the menu is closed. |
also | MAP_CB, UNMAP_CB, DESTROY_CB : common callbacks are supported. |
