mitemcurrent(3X) mitemcurrent(3X)
NAME
mitemcurrent - set and get currentmenuitem
SYNOPSIS
##include <>
int setcurrentitem(MENU *menu, const ITEM *item);
ITEM *currentitem(const MENU *menu);
int settoprow(MENU *menu, int row);
int toprow(const MENU *menu);
int itemindex(const ITEM *item);
DESCRIPTION
The function setcurrentitem sets the current item (the item on which
the menu cursor is positioned). currentitem returns a pointer to the
current item in the given menu.
The function settoprow 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 OROWMAJOR option is toggled). The item leftmost on the given row
becomes current. The function toprow returns the number of the top
menu row being displayed.
The function itemindex returns the (zero-origin) index of item in the
menu's item pointer list.
RETURN VALUE
currentitem returns NUL on error.
toprow and itemindex return ER (the general curses error value) on
error.
setcurrentitem and settoprow return one of the following:
EOK The routine succeeded.
ESYSTEMEROR
System error occurred (see errno).
EBADARGUMENT
Routine detected an incorrect or out-of-range argument.
EBADSTATE
Routine was called from an initialization or termination function.
ENOTCONECTED
No items are connected to the menu.
SEE ALSO
curses(3X), menu(3X).
NOTES
The header file <> automatically includes the header file
<>.
PORTABILITY
These routines emulate the System V menu library. They were not sup-
ported on Version 7 or BSD versions.
The SVr4 menu library documentation specifies the toprow and
indexitem error value as -1 (which is the value of ER).
AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S.
Raymond.
mitemcurrent(3X)
|