Man menu item

From LSWiki

Revision as of 16:45, 11 June 2007; Laine (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search

Contents

Files

/daemon/input.c
/def/descriptor/menu_item.c
/lib/descriptors/menu_item.h

Description

Menu item descriptors are used by menu inputs to define their menu options. See 'man input' for documentation on the input system itself, 'man descriptors' for a general overview of the descriptor system, and 'man dialog' for documentation of dialog descriptors.

As with dialog descriptors, the best header file to rely upon for picking up the menu item descriptor support is input.h.

Public Fields

Menu_Item_Key: The text the user enters in order to select the menu item. Often a single letter, but not necessarily so.

Menu_Item_Desc: The description of the menu item, as it will appear in the menu display constructed automatically by the menu dialog. Dialog colorization applies. In the case of a closure, received an extra second argument of the menu item descriptor.

Menu_Item_Action: The action to take upon the menu item being selected. If none is specified, the dialog's Dialog_Action is used.

Menu_Item_Access: Can be used to specify a closure that will determine whether a menu item is usable and will appear in the menu. The closure is passed the dialog descriptor as argument; if it returns True, the menu item is accessible, and if it returns False it is not.

Menu_Item_Access_Message: A message that will be displayed if a user attempts to select the menu item when it cannot be used due to a Menu_Item_Access setting. Dialog colorization applies. If no Menu_Item_Access_Message is specified, the dialog will simply act as if the menu item were not in the menu.

Menu_Item_Args: If specified as True, the menu item will accept an argument. For example, if the Menu_Item_Key were "A", the user could type "a xyz abc", and the menu item would be selected with "xyz abc" as its argument. The argument will be placed in the Dialog_Argument field of the dialog descriptor.

Menu_Item_Extra: A space provided in the descriptor for user-defined data. Put anything in this field you want and use it any way you want.

Internal Fields

Menu_Item_Tag: The tag for the descriptor system.

See Also

input(mechanisms), dialog(descriptors), descriptors(mechanisms)

Personal tools