cursslk(3X) cursslk(3X)
NAME
slkinit, slkset, slkrefresh, slknoutrefresh, slklabel, slkclear,
slkrestore, slktouch, slkattron, slkattrset, slkattroff,
slkattron, slkattrset, slkattroff, slkattr, slkcolor - curses
soft label routines
SYNOPSIS
##include <>
int slkinit(int fmt);;
int slkset(int labnum,, const char **label,, int fmt);;
int slkrefresh(void);;
int slknoutrefresh(void);;
char **slklabel(int labnum);;
int slkclear(void);;
int slkrestore(void);;
int slktouch(void);;
int slkattron(const chtype attrs);;
int slkattroff(const chtype attrs);;
int slkattrset(const chtype attrs);;
int slkattron(attrt attrs,, void** opts);;
int slkattroff(const attrt attrs,, void ** opts);;
int slkattrset(const attrt attrs,,
short colorpairnumber,, void** opts);;
attrt slkattr(void);;
int slkcolor(short colorpairnumber);;
DESCRIPTION
The slk* functions manipulate the set of soft function-key labels that
exist on many terminals. For those terminals that do not have soft
labels, curses takes over the bottom line of stdscr, reducing the size
of stdscr and the variable LINES. curses standardizes on eight labels
of up to eight characters each. In addition to this, the ncurses imple-
mentation supports a mode where it simulates 12 labels of up to five
characters each. This is most common for todays PC like enduser
devices. Please note that ncurses simulates this mode by taking over
up to two lines at the bottom of the screen, it doesn't try to use any
hardware support for this mode.
The slkinit routine must be called before initscr or newterm is
called. If initscr eventually uses a line from stdscr to emulate the
soft labels, then fmt determines how the labels are arranged on the
screen. Setting fmt to 00 indicates a 3-2-3 arrangement of the labels,
1 indicates a 4-4 arrangement and 2 indicates the PC like 4-4-4 mode.
If fmt is set to 3, it is again the PC like 4-4-4 mode, but in addition
an index line is generated, helping the user to identify the key num-
bers easily.
The slkset routine requires labnum to be a label number, from 1 to 8
(resp. 12); label must be the string to be put on the label, up to
eight (resp. five) characters in length. A null string or a null
pointer sets up a blank label. fmt is either 00, 1, or 2, indicating
whether the label is to be left-justified, centered, or right-justi-
fied, respectively, within the label.
The slkrefresh and slknoutrefresh routines correspond to the wrefresh
and wnoutrefresh routines.
The slklabel routine returns the current label for label number lab-
num, with leading and trailing blanks stripped.
The slkclear routine clears the soft labels from the screen.
The slkrestore routine restores the soft labels to the screen after a
slkclear has been performed.
The slktouch routine forces all the soft labels to be output the next
time a slknoutrefresh is performed.
The slkattron, slkattrset, slkattroff and slkattr routines corre-
spond to attron, attrset, attroff and attrget. They have an effect
only if soft labels are simulated on the bottom line of the screen.
The default highlight for soft keys is ASTANDOUT (as in System V
curses, which does not document this fact).
The slkcolor routine corresponds to colorset. It has an effect only
if soft labels are simulated on the bottom line of the screen.
RETURN VALUE
These routines return ER upon failure and OK (SVr4 specifies only "an
integer value other than ER") upon successful completion. slkattr
returns the attribute used for the soft keys.
slklabel returns NUL on error.
NOTES
Most applications would use slknoutrefresh because a wrefresh is
likely to follow soon.
PORTABILITY
The XSI Curses standard, Issue 4, describes these functions. It
changes the argument type of the attribute-manipulation functions
slkattron, slkattroff, slkattrset to be attrt, and adds const qual-
ifiers. The format codes 2 and 3 for slkinit() and the function
slkattr are specific to ncurses.
SEE ALSO
curses(3X), cursattr(3X), cursinitscr(3X), cursrefresh(3X)
cursslk(3X)
|