IupMenu

IUP - Portable User Interface

IupMenu

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 ignored.

Creation

Ihandle* IupMenu(Ihandle *elem1, Ihandle *elem2,..., NULL); [in C]
iupmenu{elem1, elem2, ...: iuplua_tag} -> (elem: iuplua_tag) [in IupLua3]
iup.menu{elem1, elem2, ...: iuplua_tag} -> (elem: iuplua_tag) [in IupLua5]
menu(elem1, elem2, ...) [in LED]

elem1, elem2, ...: List of identifiers that will be grouped by the menu. NULL defines the end of the list in C.

This function returns the identifier of the created menu, or NULL if an error occurs.

Callbacks

OPEN_CB: Called just before a submenu is opened.

MENUCLOSE_CB: Called right before the submenu is closed.

Lua BindingĀ 

Offers a "cleaner" syntax than LED for defining menu, submenu and separator items. The list of elements in the menu is described as a string, with one element after the other, separated by commas.

Each element can be:

1) {"<item_name>","<action>"} - menu item
2) {"<submenu_name>","<menu>"} - submenu
3) {} - separator
4) <interface element> - submenu item

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.

In Motif the menu does not inherit attributes from the dialog like in the Windows driver. This should be solved in future versions.

Examples

See Also

IupDialog, IupPopup, IupItem, IupSeparator, IupSubmenu