slk functions in the
(ncurses slk) library 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
thus the return value of the procedure
standardizes on eight labels of up to eight characters each. In
addition to this, the ncurses implementation supports a mode where it
simulates 12 labels of up to five characters each. This is most common
for today’s PC like end-user 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.
This API is definitely in flux.
slk-init routine must be called before
newterm is called. If
initscr eventually uses a line
stdscr to emulate the soft labels, then fmt
determines how the labels are arranged on the screen. Setting
0 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 numbers easily.
#t if fmt is a valid value, or
slk-set 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. fmt
is either 0, 1, or 2, indicating whether the label is to be
left-justified, centered, or right-justified, respectively, within
The procedure returns
#f if the terminal or the softkeys
were not initialized, or the labnum parameter is outside the
range of label counts, or if the format parameter is outside the range
0..2, or if memory for the labels cannot be allocated. Otherwise it
These procedure do a
noutrefresh operation on
the slk window.
slk-label routine returns the current label for label
number labnum, with leading and trailing blanks stripped.
This routine clears the soft labels from the screen.
This procedure restores the soft labels after an
This routine forces all the soft labels to be output next time
slk-noutrefresh is performed.
slk-attr-off! routines correspond to
attr-off!. They have an effect only if soft
labels are simulated on the bottom line of the screen. The default
highlight for soft keys is
slk-color! routine corresponds to
color-set!. It has
an effect only if soft labels are simulated on the bottom line of the
slk-attr returns the attributes and color pair
currently set for the soft keys. They are returned as a list of two
elements. The first element is a bitmap of attributes; the second
element is a color pair number.