]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_slk.3x
ncurses 4.2
[ncurses.git] / man / curs_slk.3x
1 .TH curs_slk 3X ""
2 .SH NAME
3 \fBslk_init\fR, \fBslk_set\fR, \fBslk_refresh\fR,
4 \fBslk_noutrefresh\fR, \fBslk_label\fR, \fBslk_clear\fR, \fBslk_restore\fR,
5 \fBslk_touch\fR, \fBslk_attron\fR, \fBslk_attrset\fR, \fBslk_attroff\fR -
6 \fBcurses\fR soft label routines
7 .SH SYNOPSIS
8 \fB#include <curses.h>\fR
9
10 \fBint slk_init(int fmt);\fR
11 .br
12 \fBint slk_set(int labnum, const char *label, int fmt);\fR
13 .br
14 \fBint slk_refresh(void);\fR
15 .br
16 \fBint slk_noutrefresh(void);\fR
17 .br
18 \fBchar *slk_label(int labnum);\fR
19 .br
20 \fBint slk_clear(void);\fR
21 .br
22 \fBint slk_restore(void);\fR
23 .br
24 \fBint slk_touch(void);\fR
25 .br
26 \fBint slk_attron(attr_t attrs);\fR
27 .br
28 \fBint slk_attrset(attr_t attrs);\fR
29 .br
30 \fBattr_t slk_attr(void);\fR
31 .br
32 \fBint slk_attroff(attr_t attrs);\fR
33 .br
34 .SH DESCRIPTION
35 The slk* functions manipulate the set of soft function-key labels that exist on
36 many terminals.  For those terminals that do not have soft labels,
37 \fBcurses\fR takes over the bottom line of \fBstdscr\fR, reducing the size of
38 \fBstdscr\fR and the variable \fBLINES\fR.  \fBcurses\fR standardizes on eight
39 labels of up to eight characters each. In addition to this, the ncurses 
40 implementation supports a mode where it simulates 12 labels of up to five
41 characters each. This is most common for todays PC like enduser devices.
42 Please note that ncurses simulates this mode by taking over up to two lines at
43 the bottom of the screen, it doesn't try to use any hardware support for this
44 mode.
45
46 The \fBslk_init\fR routine must be called before \fBinitscr\fR or \fBnewterm\fR
47 is called.  If \fBinitscr\fR eventually uses a line from \fBstdscr\fR to
48 emulate the soft labels, then \fIfmt\fR determines how the labels are arranged
49 on the screen.  Setting \fIfmt\fR to \fB0\fR indicates a 3-2-3 arrangement of
50 the labels, \fB1\fR indicates a 4-4 arrangement and \fB2\fR indicates the
51 PC like 4-4-4 mode. If \fBfmt\fR is set to \fB3\fR, it is again the PC like
52 4-4-4 mode, but in addition an index line is generated, helping the user to
53 identify the key numbers easily.
54
55 The \fBslk_set\fR routine requires \fIlabnum\fR to be a label number,
56 from \fB1\fR to \fB8\fR (resp. \fB12\fR); \fIlabel\fR must be the string 
57 to be put on the label, up to eight (resp. five) characters in length.
58 A null string or a null pointer sets up a blank label. \fIfmt\fR is either
59 \fB0\fR, \fB1\fR, or \fB2\fR, indicating whether the label is  to be 
60 left-justified, centered, or right-justified, respectively, within the
61 label.
62
63 The \fBslk_refresh\fR and \fBslk_noutrefresh\fR routines correspond to
64 the \fBwrefresh\fR and \fBwnoutrefresh\fR routines.
65
66 The \fBslk_label\fR routine returns the current label for label number
67 \fIlabnum\fR, with leading and trailing blanks stripped.
68
69 The \fBslk_clear\fR routine clears the soft labels from the screen.
70
71 The \fBslk_restore\fR routine, restores the soft labels to the screen
72 after a \fBslk_clear\fR has been performed.
73
74 The \fBslk_touch\fR routine forces all the soft labels to be output
75 the next time a \fBslk_noutrefresh\fR is performed.
76
77 The \fBslk_attron\fR, \fBslk_attrset\fR, \fBslk_attroff\fR and \fBslk_attr\fR
78 routines correspond to \fBattron\fR, \fBattrset\fR, \fBattroff\fR and \fBattr_get\fR.
79 They have an effect only if soft labels are simulated on the bottom line of
80 the screen.  The default highlight for soft keys is A_STANDOUT (as in 
81 System V curses, which does not document this fact).
82 .SH RETURN VALUE
83 These routines return \fBERR\fR upon failure and OK (SVr4 specifies only "an
84 integer value other than \fBERR\fR") upon successful completion. \fBslk_attr\fR
85 returns the attribute used for the soft keys.
86
87 \fBslk_label\fR returns \fBNULL\fR on error.
88 .SH NOTES
89 Most applications would use \fBslk_noutrefresh\fR because a
90 \fBwrefresh\fR is likely to follow soon.
91 .SH PORTABILITY
92 The XSI Curses standard, Issue 4, describes these functions.  It changes the
93 argument type of the attribute-manipulation functions \fBslk_attron\fR,
94 \fBslk_attroff\fR, \fBslk_attrset\fR to be \fBattr_t\fR, and adds \fBconst\fR
95 qualifiers. The format codes \fB2\fR and \fB3\fR for \fBslk_init()\fR and the
96 function \fBslk_attr\fR are specific to ncurses.
97 .SH SEE ALSO
98 \fBcurses\fR(3X), \fBcurs_attr\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_refresh\fR(3X)
99 .\"#
100 .\"# The following sets edit modes for GNU EMACS
101 .\"# Local Variables:
102 .\"# mode:nroff
103 .\"# fill-column:79
104 .\"# End: