Manipulating soft labels

Curses provides subroutines for manipulating soft function-key labels.

These labels appear at the bottom of the screen and give applications, such as editors, a more user-friendly look. To use soft labels, you must call the slk_init subroutine before calling the initscr or newterm subroutines.

Subroutine Description
slk_clear Clears soft labels from the screen.
slk_init Initializes soft function key labels.
slk_label Returns the current label.
slk_noutrefresh Refreshes soft labels. This subroutine is functionally equivalent to the wnoutrefresh subroutine.
slk_refresh Refreshes soft labels. This subroutine is functionally equivalent to the refresh subroutine.
slk_restore Restores the soft labels to the screen after a call to the slk_clear subroutine.
slk_set Sets a soft label.
slk_touch Updates soft labels on the next call to the slk_noutrefresh subroutine.

To manage soft labels, curses reduces the size of the stdscr by one line. It reserves this line for use by the soft-label functions. This reservation means that the LINES environment variable is also reduced. Many terminals support built-in soft labels. If built-in soft labels are supported, curses uses them. Otherwise, curses simulates the soft-labels with software.

Because many terminals that support soft labels have 8 labels, curses follows the same standard. A label string is restricted to 8 characters. Curses arranges labels in one of two patterns:  3-2-3 (3 left, 2 center, 3 right) or 4-4 (4 left, 4 right).

To specify a string for a particular label, call the slk_set subroutine. This subroutine also instructs curses to left-justify, right-justify, or center the string on the label. To obtain a label name before it was justified by the slk_set subroutine, use the slk_label subroutine. The slk_clear and slk_restore subroutines clear and restore soft labels respectively. Normally, to update soft labels, your program should call the slk_noutrefresh subroutine for each label and then use a single call to the slk_refresh subroutine to perform the actual output. To output all the soft labels on the next call to the slk_noutrefresh subroutine, use the slk_touch subroutine.