menu(3X) menu(3X)
NAME
menu - curses extension for programming menus
SYNOPSIS
##include <>
DESCRIPTION
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 inter-
action with the user.
The menu library uses the curses libraries, and a curses initialization
routine such as initscr must be called before using any of these func-
tions. To use the menu library, link with the options -lmenu -lcurses.
Current Default Values for Item Attributes
The menu library maintains a default value for item attributes. You
can get or set this default by calling the appropriate get or set
routine with a NUL item pointer. Changing this default with a set
function affects future item creations, but does not change the render-
ing of items already created.
Routine Name Index
The following table lists each menu routine and the name of the manual
page on which it is described.
curses Routine Name Manual Page Name
--------------------------------------------
currentitem mitemcurrent(3X)
freeitem mitemnew(3X)
freemenu menunew(3X)
itemcount menuitems(3X)
itemdescription mitemname(3X)
itemindex mitemcurrent(3X)
iteminit menuhook(3X)
itemname mitemname(3X)
itemopts mitemopts(3X)
itemoptsoff mitemopts(3X)
itemoptson mitemopts(3X)
itemterm menuhook(3X)
itemuserptr mitemuserptr(3X)
itemvalue mitemvalue(3X)
itemvisible mitemvisible(3X)
menuback menuattributes(3X)
menudriver menudriver(3X)
menufore menuattributes(3X)
menuformat menuformat(3X)
menugrey menuattributes(3X)
menuinit menuhook(3X)
menuitems menuitems(3X)
menumark menumark(3X)
menuopts menuopts(3X)
menuoptsoff menuopts(3X)
menuoptson menuopts(3X)
menupad menuattributes(3X)
menupattern menupattern(3X)
menurequestbyname menurequestname(3X)
menurequestname menurequestname(3X)
menuspacing menuspacing(3X)
menusub menuwin(3X)
menuterm menuhook(3X)
menuuserptr menuuserptr(3X)
menuwin menuwin(3X)
newitem mitemnew(3X)
newmenu menunew(3X)
posmenucursor menucursor(3X)
postmenu menupost(3X)
scalemenu menuwin(3X)
setcurrentitem mitemcurrent(3X)
setiteminit menuhook(3X)
setitemopts mitemopts(3X)
setitemterm menuhook(3X)
setitemuserptr mitemuserptr(3X)
setitemvalue mitemvalue(3X)
setmenuback menuattributes(3X)
setmenufore menuattributes(3X)
setmenuformat menuformat(3X)
setmenugrey menuattributes(3X)
setmenuinit menuhook(3X)
setmenuitems menuitems(3X)
setmenumark menumark(3X)
setmenuopts mitemopts(3X)
setmenupad menuattributes(3X)
setmenupattern menupattern(3X)
setmenuspacing menuspacing(3X)
setmenusub menuwin(3X)
setmenuterm menuhook(3X)
setmenuuserptr menuuserptr(3X)
setmenuwin menuwin(3X)
settoprow mitemcurrent(3X)
toprow mitemcurrent(3X)
unpostmenu menupost(3X)
RETURN VALUE
Routines that return pointers return NUL on error. Routines that
return an integer return one of the following error codes:
EOK The routine succeeded.
ESYSTEMEROR
System error occurred (see errno).
EBADARGUMENT
Routine detected an incorrect or out-of-range argument.
EPOSTED
The menu is already posted.
EBADSTATE
Routine was called from an initialization or termination function.
ENOROM
Menu is too large for its window.
ENOTPOSTED
The menu has not been posted.
EUNKNOWNCOMAND
The menu driver code saw an unknown request code.
ENOMATCH
Character failed to match.
ENOTSELECTABLE
The designated item cannot be selected.
ENOTCONECTED
No items are connected to the menu.
EREQUESTDENIED
The menu driver could not process the request.
SEE ALSO
curses(3X) and related pages whose names begin "menu" for detailed
descriptions of the entry points.
NOTES
The header file <> automatically includes the header files
<> and <>.
In your library list, libmenu.a should be before libncurses.a; that is,
you want to say `-lmenu -lncurses', not the other way around (which
would give you a link error using GNU ld(1) and many other linkers).
PORTABILITY
These routines emulate the System V menu library. They were not sup-
ported on Version 7 or BSD versions.
AUTHORS
Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric S.
Raymond.
menu(3X)
|