|
|
#include <curses.h>int slk_attroff(const chtype attrs);
int slk_attr_off(const attr_t attrs, void *opts);
int slk_attron(const chtype attrs);
int slk_attr_on(const attr_t attrs, void *opts);
int slk_attrset(const chtype attrs);
int slk_attr_set(const attr_t attrs, short color_pair_number, void *opts);
int slk_clear(void);
int slk_color(short color_pair_number);
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);
To use soft labels, slk_init(3curses) must be called before initscr(3curses), newterm(3curses) or ripoffline(3curses) is called. If initscr(3curses) 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 0 indicates a 3-2-3 arrangement of the labels; 1 indicates a 4-4 arrangement. Other values for fmt are unspecified.
The slk_init(3curses) function has the effect of calling ripoffline(3curses) to reserve one screen line to accommodate the requested format.
The slk_set(3curses) and slk_wset(3curses) functions specify the text of soft label number labnum, within the range from 1 to and including 8. The label argument is the string to be put on the label. With slk_set(3curses), and slk_wset(3curses), the width of the label is limited to eight column positions. A null string or a null pointer specifies a blank label. The justify argument can have the following values to indicate how to justify label within the space reserved for it:
The slk_refresh(3curses) and slk_noutrefresh(3curses) functions correspond to the wrefresh(3curses) and wnoutrefresh(3curses) functions.
The slk_label(3curses) function obtains soft label number labnum.
The slk_clear(3curses) function immediately clears the soft labels from the screen.
The slk_restore(3curses) function immediately restores the soft labels to the screen after a call to slk_clear(3curses).
The slk_touch(3curses) function forces all the soft labels to be output the next time slk_noutrefresh(3curses) or slk_refresh(3curses) is called.
The slk_attron(3curses), slk_attrset(3curses) and slk_attroff(3curses) functions correspond to attron(3curses), attrset(3curses), and attroff(3curses). They have an effect only if soft labels are simulated on the bottom line of the screen.
The slk_attr_off(3curses), slk_attr_on(3curses), slk_attr_set(3curses), and slk_color(3curses) functions correspond to slk_attroff(3curses), slk_attron(3curses), slk_attrset(3curses) and color_set(3curses) and thus support the attribute constants with the WA_ prefix and colour.
The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.
Upon successful completion, the other functions return OK. Otherwise, they return ERR.
Since the number of columns that a wide character string will occupy is codeset-specific, call wcwidth(3C) and wcswidth(3C) to check the number of column positions in the string before calling slk_wset(3curses).
Most applications would use slk_noutrefresh(3curses) because a wrefresh(3curses) is likely to follow soon.