src/swipl-devel/packages/xpce/man/refmanual/md/menu_item.md

class menu_item {#class-menu_item}

A menu_item is an item of a menu. Note that class popup is a subclass of menu and therefore menu_items also describe entries of popups.

The menu_items of a menu are organised in a chain (menu <-members). The menu decides on the layout and how they are displayed. The menu also takes care of handling the user-interaction.

The <->value of a menu_item is used to address it in the menu. The <->label determines what is shown on the display, It can either be a string or a bitmap. The <->message what happens if the user selects this menu_item. The message may be @default, in which case the message associated with the menu is used. <->end_group tells the menu this is the last entry of a logical group. Used by popup's only. Finally, the <->condition is a code object that determines whether or not the item should be active when in a popup.

User interface:

Menu_items are no graphical objects. Their visual appearance and user-interface is entirely determined by the menu.

Bugs:

The <->end_group facility is at te wrong place: it harms reusability (which is not used very often anyway) and it makes changes to menu's difficult. It might be wiser to introduce a menu_item_group object to bundle menu items.

@see class popup @see class menu_bar @see class menu

Instance variables {#class-menu_item-instvars}

Send methods {#class-menu_item-send}

Get methods {#class-menu_item-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.