Expand description

NCurses Menu module

The menu library provides terminal-independent facilities for composing menu systems on character-cell terminals. The library includes: item routines, which create and modify menu items; and menu routines, which group items into menus, display menus on the screen, and handle interaction with the user.

Structs

Menu item options.

Menu options.

Menu size (rows and columns).

Menu spacing (layout spacing).

Enums

Menu item options.

Menu option.

Menu request.

NCursesw menu errors.

Functions

Returns a pointer to the current item in the given menu.

De-allocates a menu item.

Disconnects menu from its item array and frees the storage allocated for the menu.

Returns the count of items in menu.

Returns the description part of the given menu item.

Returns the (zero-origin) index of item in the menu’s item pointer list.

Returns the current menu item init hook.

Returns the name part of the given menu item.

Returns the item’s current options.

Turns off the given options, and leaves others alone.

Turns on the given options, and leaves others alone.

Returns the current menu item term hook.

Returns the menu item user pointer.

Returns the menu items value.

Returns if the menu item is visible.

Returns the background attribute. The default is normal::Attributes::Normal.

command-processing loop of the menu system.

Returns the foreground attribute. The default is normal::Attributes::Reverse.

Returns the maximum-size constraints for the given menu into the storage addressed by rows and cols.

Returns the grey attribute. The default is normal::Attributes::Underline.

Returns the current menu init hook.

Returns the menu items as a vector of the given menu.

Returns the menu’s mark string.

Returns the menu’s current options.

Turns off the given options, and leaves others alone.

Turns on the given options, and leaves others alone.

Returns the given menu’s pad character. The default is a blank.

Returns the pattern buffer of the given menu.

Searches in the name-table for a request with the given name and returns its MenuRequest. Otherwise None is returned.

Returns the printable name of a menu request code.

Returns the spacing info for the menu.

Returns the menus sub-window.

Returns the current menu term hook.

Returns the menu user pointer.

Returns the menus main-window.

Allocates a new item and initializes it from the name and description

Creates a new menu connected to a specified vector of menu item.

Screen function of new_menu().

Restores the cursor to the current position associated with the menu’s selected item. This is useful after NCurses routines have been called to do screen-painting in response to a menu select.

Displays a menu to its associated subwindow. To trigger physical display of the sub-window, use refresh() or some equivalent curses routine (the implicit doupdate() triggered by an NCurses input request will do). post_menu() resets the selection status of all items.

Returns the minimum size required for the sub-window of menu.

Sets the current item (the item on which the menu cursor is positioned).

Sets a hook to be called at menu-post time and each time the selected item changes (after the change).

Sets all the given item’s options.

Sets a hook to be called at menu-unpost time and each time the selected item changes (before the change).

Sets the menu item user pointer.

Sets the menu items value.

Sets the background attribute of menu. This is the highlight used for selectable (but not currently selected) menu items.

Sets the foreground attribute of menu. This is the highlight used for selected menu items.

Sets the maximum display size of the given menu. If this size is too small to display all menu items, the menu will be made scrollable. If this size is larger than the menus sub-window and the sub-window is too small to display all menu items, post_menu() will fail.

Sets the grey attribute of menu. This is the highlight used for un-selectable menu items in menus that permit more than one selection.

Sets a hook to be called at menu-post time and just after the top row on the menu changes once it is posted.

Changes the menu items using a vector of menu items for the given menu.

Sets the mark string for the given menu. Note that changing the length of the mark string for a menu while the menu is posted is likely to produce undefined behavior. The default string is “-” (a dash).

Sets all the given item’s options.

Sets the character used to fill the space between the name and description parts of a menu item.

Sets the pattern buffer for the given menu and tries to find the first matching item. If it succeeds, that item becomes current; if not, the current item does not change.

Sets the spacing information for the menu. Its parameter MenuSpacing::spc_description controls the number of spaces between an item name and an item description. It must not be larger than TABSIZE. The menu system puts in the middle of this spacing area the pad character. The remaining parts are filled with spaces. The MenuSpacing::spc_rows parameter controls the number of rows that are used for an item. It must not be larger than 3. The menu system inserts the blank lines between item rows, these lines will contain the pad character in the appropriate positions. The MenuSpacing::spc_columns parameter controls the number of blanks between columns of items. It must not be larger than TABSIZE. A value of 0 for all the spacing values resets them to the default, which is 1 for all of them.

Sets the menus sub-window. if form is None then window is default for all forms, if window is None the stdscr() is used.

Sets a hook to be called at menu-unpost time and just before the top row on the menu changes once it is posted.

Sets the menu user pointer.

Sets the menus main-window. if form is None then window is default for all forms, if window is None the stdscr() is used.

Sets the top row of the menu to show the given row (the top row is initially 0, and is reset to this value whenever the MenuOption::RowMajor option is toggled). The item leftmost on the given row becomes current.

Returns the number of the top menu row being displayed.

Erases menu from its associated subwindow.

Type Definitions

Menu item.

Menu.

User pointer.

Menu callback function.