IupItem

IUP - Portable User Interface

IupItem

Creates an item of the menu interface element. When selected, it generates an action.

Creation

Ihandle* IupItem(char *title, char *action); [in C]
iupitem(title = title: string) -> elem: iuplua_tag [in IupLua3]
iup.item(title = title: string) -> elem: iuplua_tag [in IupLua5]
item(title, action) [in LED]

title: Text to be shown on the item.
action: Name of the action generated when the item is selected.

This function returns the identifier of the created item.

Attributes

KEY: Associates a key to the item.

VALUE: Indicates the item's state. When the value is ON, a mark will be displayed to the left of the item. Default: OFF.

TITLE: Text shown to the user. It is possible to change its value on-the-fly.

IMAGE: (Windows Only) Image of the non-checked menu item. The size should be are 16x16.

IMPRESS: (Windows Only) Image of the checked menu item.

Callbacks

ACTION: Action generated when the item is selected.

HIGHLIGHT_CB: Action generated when the item is highlighted.

Notes

The text of the menu item accepts the control character '\t' to force text alignment to the right after this character. This is used to add shortcut keys to the menu, aligned to the right. Ex.: "Save\tCtrl+S".

Menu items are activated using the Enter key.

Attention: Never use the same menu item in different menus.

Examples

See Also

IupSeparator, IupSubmenu, IupMenu.