summaryrefslogtreecommitdiffstats
path: root/ncurses-5.3/doc/html/man/curs_slk.3x.html
blob: 9a0a29a4a6ef5814507b1b9ffb98090eaa9a8772 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!-- 
  ****************************************************************************
  * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  * "Software"), to deal in the Software without restriction, including      *
  * without limitation the rights to use, copy, modify, merge, publish,      *
  * distribute, distribute with modifications, sublicense, and/or sell       *
  * copies of the Software, and to permit persons to whom the Software is    *
  * furnished to do so, subject to the following conditions:                 *
  *                                                                          *
  * The above copyright notice and this permission notice shall be included  *
  * in all copies or substantial portions of the Software.                   *
  *                                                                          *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
  *                                                                          *
  * Except as contained in this notice, the name(s) of the above copyright   *
  * holders shall not be used in advertising or otherwise to promote the     *
  * sale, use or other dealings in this Software without prior written       *
  * authorization.                                                           *
  ****************************************************************************
  * @Id: curs_slk.3x,v 1.11 2001/03/03 21:05:41 Todd.C.Miller Exp @
-->
<HTML>
<HEAD>
<TITLE>curs_slk 3x</TITLE>
<link rev=made href="mailto:bug-ncurses@gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<H1>curs_slk 3x</H1>
<HR>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->

</PRE>
<H2>NAME</H2><PRE>
       <STRONG>slk_init</STRONG>,     <STRONG>slk_set</STRONG>,    <STRONG>slk_refresh</STRONG>,    <STRONG>slk_noutrefresh</STRONG>,
       <STRONG>slk_label</STRONG>, <STRONG>slk_clear</STRONG>, <STRONG>slk_restore</STRONG>, <STRONG>slk_touch</STRONG>,  <STRONG>slk_attron</STRONG>,
       <STRONG>slk_attrset</STRONG>,   <STRONG>slk_attroff</STRONG>,   <STRONG>slk_attr_on</STRONG>,   <STRONG>slk_attr_set</STRONG>,
       <STRONG>slk_attr_off</STRONG>, <STRONG>slk_attr</STRONG>, <STRONG>slk_color</STRONG> - <STRONG>curses</STRONG> soft label rou-
       tines


</PRE>
<H2>SYNOPSIS</H2><PRE>
       <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>

       <STRONG>int</STRONG> <STRONG>slk_init(int</STRONG> <STRONG>fmt);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_set(int</STRONG> <STRONG>labnum,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*label,</STRONG> <STRONG>int</STRONG> <STRONG>fmt);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_refresh(void);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_noutrefresh(void);</STRONG>
       <STRONG>char</STRONG> <STRONG>*slk_label(int</STRONG> <STRONG>labnum);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_clear(void);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_restore(void);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_touch(void);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_attron(const</STRONG> <STRONG>chtype</STRONG> <STRONG>attrs);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_attroff(const</STRONG> <STRONG>chtype</STRONG> <STRONG>attrs);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_attrset(const</STRONG> <STRONG>chtype</STRONG> <STRONG>attrs);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_attr_on(attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>void*</STRONG> <STRONG>opts);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_attr_off(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG> <STRONG>opts);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_attr_set(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG>
            <STRONG>short</STRONG> <STRONG>color_pair_number,</STRONG> <STRONG>void*</STRONG> <STRONG>opts);</STRONG>
       <STRONG>attr_t</STRONG> <STRONG>slk_attr(void);</STRONG>
       <STRONG>int</STRONG> <STRONG>slk_color(short</STRONG> <STRONG>color_pair_number);</STRONG>


</PRE>
<H2>DESCRIPTION</H2><PRE>
       The slk* functions manipulate the set of soft function-key
       labels that exist on many terminals.  For those  terminals
       that do not have soft labels, <STRONG>curses</STRONG> takes over the bottom
       line of <STRONG>stdscr</STRONG>, reducing the size of <STRONG>stdscr</STRONG> and the  vari-
       able  <STRONG>LINES</STRONG>.  <STRONG>curses</STRONG> 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  todays  PC  like  enduser  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.

       The <STRONG>slk_init</STRONG> routine must  be  called  before  <STRONG>initscr</STRONG>  or
       <STRONG>newterm</STRONG> is called.  If <STRONG>initscr</STRONG> eventually uses a line from
       <STRONG>stdscr</STRONG> to emulate the soft labels, then <EM>fmt</EM> determines how
       the  labels  are arranged on the screen.  Setting <EM>fmt</EM> to <STRONG>0</STRONG>
       indicates a 3-2-3 arrangement of the labels, <STRONG>1</STRONG> indicates a
       4-4 arrangement and <STRONG>2</STRONG> indicates the PC like 4-4-4 mode. If
       <STRONG>fmt</STRONG> is set to <STRONG>3</STRONG>, 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.

       The <STRONG>slk_set</STRONG> routine requires <EM>labnum</EM> to be a label  number,
       from <STRONG>1</STRONG> to <STRONG>8</STRONG> (resp. <STRONG>12</STRONG>); <EM>label</EM> must be the string to be put
       on the label, up  to  eight  (resp.  five)  characters  in
       length.   A  null string or a null pointer sets up a blank
       label. <EM>fmt</EM> is either <STRONG>0</STRONG>, <STRONG>1</STRONG>, or <STRONG>2</STRONG>,  indicating  whether  the
       label  is  to be left-justified, centered, or right-justi-
       fied, respectively, within the label.

       The <STRONG>slk_refresh</STRONG> and <STRONG>slk_noutrefresh</STRONG> routines correspond to
       the <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> routines.

       The  <STRONG>slk_label</STRONG> routine returns the current label for label
       number <EM>labnum</EM>, with leading and trailing blanks  stripped.

       The  <STRONG>slk_clear</STRONG>  routine  clears  the  soft labels from the
       screen.

       The <STRONG>slk_restore</STRONG> routine, restores the soft labels  to  the
       screen after a <STRONG>slk_clear</STRONG> has been performed.

       The  <STRONG>slk_touch</STRONG>  routine  forces  all the soft labels to be
       output the next time a <STRONG>slk_noutrefresh</STRONG> is performed.

       The <STRONG>slk_attron</STRONG>, <STRONG>slk_attrset</STRONG>, <STRONG>slk_attroff</STRONG> and <STRONG>slk_attr</STRONG> rou-
       tines correspond to <STRONG>attron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>attroff</STRONG> and <STRONG>attr_get</STRONG>.
       They have an effect only if soft labels are  simulated  on
       the  bottom line of the screen.  The default highlight for
       soft keys is A_STANDOUT (as in System V curses, which does
       not document this fact).

       The  <STRONG>slk_color</STRONG> routine corresponds to <STRONG>color_set</STRONG>. It has an
       effect only if soft labels are  simulated  on  the  bottom
       line of the screen.



</PRE>
<H2>RETURN VALUE</H2><PRE>
       These routines return <STRONG>ERR</STRONG> upon failure and OK (SVr4 speci-
       fies only "an integer value other than <STRONG>ERR</STRONG>") upon success-
       ful  completion.  <STRONG>slk_attr</STRONG>  returns the attribute used for
       the soft keys.

       <STRONG>slk_label</STRONG> returns <STRONG>NULL</STRONG> on error.


</PRE>
<H2>NOTES</H2><PRE>
       Most applications would use <STRONG>slk_noutrefresh</STRONG> because a <STRONG>wre-</STRONG>
       <STRONG>fresh</STRONG> is likely to follow soon.


</PRE>
<H2>PORTABILITY</H2><PRE>
       The  XSI  Curses  standard, Issue 4, describes these func-
       tions.  It changes the argument  type  of  the  attribute-
       manipulation     functions     <STRONG>slk_attron</STRONG>,    <STRONG>slk_attroff</STRONG>,
       <STRONG>slk_attrset</STRONG> to be <STRONG>attr_t</STRONG>, and adds <STRONG>const</STRONG>  qualifiers.  The
       format  codes  <STRONG>2</STRONG>  and  <STRONG>3</STRONG>  for  <STRONG>slk_init()</STRONG> and the function
       <STRONG>slk_attr</STRONG> are specific to ncurses.



</PRE>
<H2>SEE ALSO</H2><PRE>
       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,        <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,        <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,
       <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>



















































</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>