CURSES_SLK(3) | Library Functions Manual | CURSES_SLK(3)

# NAME

`slk_attroff`, `slk_attr_off`, `slk_attron`, `slk_attr_on`, `slk_attrset`, `slk_attr_set`, `slk_clear`, `slk_color`, `slk_init`, `slk_label`, `slk_noutrefresh`, `slk_refresh`, `slk_restore`, `slk_set`, `slk_touch`, `slk_wset` —
Curses soft label key routines

# LIBRARY

Curses Library (libcurses, -lcurses)

# SYNOPSIS

`#include <curses.h>`

int
`slk_attroff`(const chtype attr);

int
`slk_attr_off`(const attr_t attr, void *opt);

int
`slk_attron`(const chtype attr);

int
`slk_attr_on`(const attr_t attr, void *opt);

int
`slk_attrset`(const chtype attr);

int
`slk_attr_set`(const attr_t attr, short pair, void *opt);

void
`slk_clear`(void);

int
`slk_color`(short pair);

int
`slk_init`(int fmt);

char *
`slk_label`(int labnum);

int
`slk_noutrefresh`(void);

int
`slk_refresh`(void);

int
`slk_restore`(void);

int
`slk_set`(int labnum, const char *label, int justify);

int
`slk_touch`(void);

int
`slk_wset`(int labnum, const wchar_t *label, int justify);

# DESCRIPTION

This Curses interface manipulates the set of soft function-key labels that exist on some terminals. For those terminals that do not have soft labels, Curses takes over the bottom line of `stdstr`, reducing the size of `stdscr` and the value of the `LINES` external variable. There can be up to eight labels of up to eight display columns each.

To use soft labels, `slk_init`() must be called before initscr(3), newterm(3), or ripoffline(3) is called. If newterm(3) eventually uses a line from `stdscr` to emulate the soft labels, then fmt determines how the labels are arranged on the screen from the following list:

0
  indicates a 3-2-3 arrangement.
1
  indicates a 4-4 arrangement.

The `slk_set`() and `slk_wset`() functions specify the text of soft label number labnum, within the range from 1 to 8 inclusive. The label argument is the string to be put on the label. The justify argument can have the following values to indicate how to justify label within the space reserved for it:

0
  Left align.
1
  Center align.
2
  Right align.

The `slk_refresh`() and `slk_noutrefresh`() functions correspond to the wrefresh(3) and wnoutrefresh(3) functions.

The `slk_label`() function returns a pointer to the text displayed in the label.

The `slk_clear`() function immediately clears the soft labels from the screen.

The `slk_restore`() function immediately restores the soft labels to the screen after a call to `slk_clear`().

The `slk_touch`() function forces all soft labels to be output the next time `slk_noutrefresh`() or `slk_refresh`() is called.

The `slk_attron`(), `slk_attrset`() and `slk_attroff`() functions correspond to attron(3), attrset(3) and attroff(3). The have an effect only if soft labels are simulated on the bottom line of the screen.

The `slk_attr_on`(), `slk_attr_set`(), `slk_color`() and `slk_attr_off`() functions correspond to attr_on(3), attr_set(3), color_set(3) and attr_off(3) and thus support the attribute constants with the WA_ prefix and color. The have an effect only if soft labels are simulated on the bottom line of the screen.

The opt argument is reserved for future use. Currently the application must provide a NULL pointer as opt.

# RETURN VALUES

Functions returning pointers will return `NULL` if an error is detected. The functions that return an int will return one of the following values:

`OK`
  The function completed successfully.
`ERR`
  An error occurred in the function.

# SEE ALSO

terminfo(5)

# NOTES

This has not been tested on a terminal with real soft label keys. `label_height`, `label_width`, `label_format` and `lab_f*` are currently not used.

# STANDARDS

The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.

# HISTORY

The Curses package appeared in 4.0BSD. The soft label key functions were added in NetBSD 8.0.

September 29, 2018 | NetBSD 9.0