2002-10-13 11:35:53 +08:00
|
|
|
<!--
|
|
|
|
****************************************************************************
|
2010-05-30 09:08:46 +08:00
|
|
|
* Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
|
2002-10-13 11:35:53 +08:00
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
****************************************************************************
|
2011-01-09 09:17:12 +08:00
|
|
|
* @Id: curs_slk.3x,v 1.22 2010/12/04 18:38:55 tom Exp @
|
2002-10-13 11:35:53 +08:00
|
|
|
-->
|
2015-02-15 09:42:27 +08:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
2000-07-09 10:46:08 +08:00
|
|
|
<HTML>
|
2002-10-13 11:35:53 +08:00
|
|
|
<HEAD>
|
2015-02-15 09:42:27 +08:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
|
|
<meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
|
2002-10-13 11:35:53 +08:00
|
|
|
<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>
|
2000-07-09 10:46:08 +08:00
|
|
|
<BODY>
|
2002-10-13 11:35:53 +08:00
|
|
|
<H1>curs_slk 3x</H1>
|
|
|
|
<HR>
|
2000-07-09 10:46:08 +08:00
|
|
|
<PRE>
|
2005-10-10 02:41:57 +08:00
|
|
|
<STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG> <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>
|
2004-02-09 10:15:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-07-09 10:46:08 +08:00
|
|
|
|
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<H2><a name="h2-NAME">NAME</a></H2><PRE>
|
2010-09-19 08:45:46 +08:00
|
|
|
<STRONG>slk_init</STRONG>, <STRONG>slk_set</STRONG>, <STRONG>slk_wset</STRONG>, <STRONG>slk_refresh</STRONG>, <STRONG>slk_noutrefresh</STRONG>,
|
2005-10-10 02:41:57 +08:00
|
|
|
<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
|
|
|
|
routines
|
2000-07-09 10:46:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
2002-10-13 11:35:53 +08:00
|
|
|
<STRONG>#include</STRONG> <STRONG><curses.h></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>
|
2010-10-03 08:50:21 +08:00
|
|
|
<STRONG>int</STRONG> <STRONG>slk_attr_set(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>short</STRONG> <STRONG>color_pair,</STRONG>
|
|
|
|
<STRONG>void*</STRONG> <STRONG>opts);</STRONG>
|
2002-10-13 11:35:53 +08:00
|
|
|
<STRONG>attr_t</STRONG> <STRONG>slk_attr(void);</STRONG>
|
2010-10-03 08:50:21 +08:00
|
|
|
<STRONG>int</STRONG> <STRONG>slk_color(short</STRONG> <STRONG>color_pair);</STRONG>
|
|
|
|
<STRONG>int</STRONG> <STRONG>slk_wset(int</STRONG> <STRONG>labnum,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*label,</STRONG> <STRONG>int</STRONG> <STRONG>fmt);</STRONG>
|
2000-07-09 10:46:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
2000-07-09 10:46:08 +08:00
|
|
|
The slk* functions manipulate the set of soft function-key
|
2010-10-03 08:50:21 +08:00
|
|
|
labels that exist on many terminals. For those terminals
|
2002-10-13 11:35:53 +08:00
|
|
|
that do not have soft labels, <STRONG>curses</STRONG> takes over the bottom
|
2010-10-03 08:50:21 +08:00
|
|
|
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 la-
|
|
|
|
bels of up to five characters each. This is useful for
|
|
|
|
today's PC-like enduser devices. ncurses simulates this
|
|
|
|
mode by taking over up to two lines at the bottom of the
|
|
|
|
screen; it does not try to use any hardware support for
|
2010-05-30 09:08:46 +08:00
|
|
|
this mode.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
The <STRONG>slk_init</STRONG> routine must be called before <STRONG>initscr</STRONG> or
|
2002-10-13 11:35:53 +08:00
|
|
|
<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
|
2010-05-30 09:08:46 +08:00
|
|
|
the labels are arranged on the screen:
|
|
|
|
|
|
|
|
<STRONG>0</STRONG> indicates a 3-2-3 arrangement of the labels.
|
|
|
|
|
|
|
|
<STRONG>1</STRONG> indicates a 4-4 arrangement
|
|
|
|
|
|
|
|
<STRONG>2</STRONG> indicates the PC-like 4-4-4 mode.
|
|
|
|
|
|
|
|
<STRONG>3</STRONG> is again the PC-like 4-4-4 mode, but in addition
|
2010-10-03 08:50:21 +08:00
|
|
|
an index line is generated, helping the user to
|
2010-05-30 09:08:46 +08:00
|
|
|
identify the key numbers easily.
|
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
The <STRONG>slk_set</STRONG> routine (and the <STRONG>slk_wset</STRONG> routine for the
|
2010-09-19 08:45:46 +08:00
|
|
|
wide-character library) has three parameters:
|
2010-05-30 09:08:46 +08:00
|
|
|
|
|
|
|
<EM>labnum</EM>
|
2010-10-03 08:50:21 +08:00
|
|
|
is the label number, from <STRONG>1</STRONG> to <STRONG>8</STRONG> (12 for <EM>fmt</EM>
|
2010-05-30 09:08:46 +08:00
|
|
|
in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>);
|
|
|
|
|
|
|
|
<EM>label</EM>
|
2010-10-03 08:50:21 +08:00
|
|
|
is be the string to put on the label, up to
|
|
|
|
eight (five for <EM>fmt</EM> in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>)
|
2010-05-30 09:08:46 +08:00
|
|
|
characters in length. A null string or a null
|
|
|
|
pointer sets up a blank label.
|
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
<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-justified, respectively, within the la-
|
2010-05-30 09:08:46 +08:00
|
|
|
bel.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
2002-10-13 11:35:53 +08:00
|
|
|
The <STRONG>slk_refresh</STRONG> and <STRONG>slk_noutrefresh</STRONG> routines correspond to
|
|
|
|
the <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> routines.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
The <STRONG>slk_label</STRONG> routine returns the current label for label
|
2010-05-30 09:08:46 +08:00
|
|
|
number <EM>labnum</EM>, with leading and trailing blanks stripped.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
The <STRONG>slk_clear</STRONG> routine clears the soft labels from the
|
2000-07-09 10:46:08 +08:00
|
|
|
screen.
|
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
The <STRONG>slk_restore</STRONG> routine restores the soft labels to the
|
2002-10-13 11:35:53 +08:00
|
|
|
screen after a <STRONG>slk_clear</STRONG> has been performed.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
The <STRONG>slk_touch</STRONG> routine forces all the soft labels to be
|
2002-10-13 11:35:53 +08:00
|
|
|
output the next time a <STRONG>slk_noutrefresh</STRONG> is performed.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
2002-10-13 11:35:53 +08:00
|
|
|
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>.
|
2010-10-03 08:50:21 +08:00
|
|
|
They have an effect only if soft labels are simulated on
|
|
|
|
the bottom line of the screen. The default highlight for
|
2000-07-09 10:46:08 +08:00
|
|
|
soft keys is A_STANDOUT (as in System V curses, which does
|
|
|
|
not document this fact).
|
|
|
|
|
2010-05-30 09:08:46 +08:00
|
|
|
The <STRONG>slk_color</STRONG> routine corresponds to <STRONG>color_set</STRONG>. It has an
|
2010-10-03 08:50:21 +08:00
|
|
|
effect only if soft labels are simulated on the bottom
|
2000-07-09 10:46:08 +08:00
|
|
|
line of the screen.
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
2002-10-13 11:35:53 +08:00
|
|
|
These routines return <STRONG>ERR</STRONG> upon failure and OK (SVr4 speci-
|
|
|
|
fies only "an integer value other than <STRONG>ERR</STRONG>") upon success-
|
2005-10-10 02:41:57 +08:00
|
|
|
ful completion.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
2010-10-03 08:50:21 +08:00
|
|
|
X/Open defines no error conditions. In this implementa-
|
2005-10-10 02:41:57 +08:00
|
|
|
tion
|
|
|
|
|
|
|
|
<STRONG>slk_attr</STRONG>
|
2010-05-30 09:08:46 +08:00
|
|
|
returns the attribute used for the soft keys.
|
2005-10-10 02:41:57 +08:00
|
|
|
|
|
|
|
<STRONG>slk_attroff</STRONG>, <STRONG>slk_attron</STRONG>, <STRONG>slk_clear</STRONG>,
|
|
|
|
<STRONG>slk_noutrefresh</STRONG>, <STRONG>slk_refresh</STRONG>, <STRONG>slk_touch</STRONG>
|
2010-10-03 08:50:21 +08:00
|
|
|
return an error if the terminal or the soft-
|
2005-10-10 02:41:57 +08:00
|
|
|
keys were not initialized.
|
|
|
|
|
|
|
|
<STRONG>slk_attrset</STRONG>
|
2010-10-03 08:50:21 +08:00
|
|
|
returns an error if the terminal or the soft-
|
2005-10-10 02:41:57 +08:00
|
|
|
keys were not initialized.
|
|
|
|
|
|
|
|
<STRONG>slk_attr_set</STRONG>
|
2010-10-03 08:50:21 +08:00
|
|
|
returns an error if the terminal or the soft-
|
|
|
|
keys were not initialized, or the color pair
|
2005-10-10 02:41:57 +08:00
|
|
|
is outside the range 0..COLOR_PAIRS-1, or opts
|
|
|
|
is not null.
|
|
|
|
|
|
|
|
<STRONG>slk_color</STRONG>
|
2010-10-03 08:50:21 +08:00
|
|
|
returns an error if the terminal or the soft-
|
|
|
|
keys were not initialized, or the color pair
|
2005-10-10 02:41:57 +08:00
|
|
|
is outside the range 0..COLOR_PAIRS-1.
|
|
|
|
|
|
|
|
<STRONG>slk_init</STRONG>
|
2010-10-03 08:50:21 +08:00
|
|
|
returns an error if the format parameter is
|
2005-10-10 02:41:57 +08:00
|
|
|
outside the range 0..3.
|
|
|
|
|
|
|
|
<STRONG>slk_label</STRONG>
|
|
|
|
returns <STRONG>NULL</STRONG> on error.
|
|
|
|
|
|
|
|
<STRONG>slk_set</STRONG>
|
2010-10-03 08:50:21 +08:00
|
|
|
returns an error if the terminal or the soft-
|
|
|
|
keys were not initialized, or the <EM>labnum</EM> pa-
|
|
|
|
rameter is outside the range of label counts,
|
|
|
|
or if the format parameter is outside the
|
2005-10-10 02:41:57 +08:00
|
|
|
range 0..2, or if memory for the labels cannot
|
|
|
|
be allocated.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
2002-10-13 11:35:53 +08:00
|
|
|
Most applications would use <STRONG>slk_noutrefresh</STRONG> because a <STRONG>wre-</STRONG>
|
|
|
|
<STRONG>fresh</STRONG> is likely to follow soon.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
2010-10-03 08:50:21 +08:00
|
|
|
The XSI Curses standard, Issue 4, describes these func-
|
|
|
|
tions. It changes the argument type of the attribute-ma-
|
|
|
|
nipulation functions <STRONG>slk_attron</STRONG>, <STRONG>slk_attroff</STRONG>, <STRONG>slk_attrset</STRONG>
|
2010-05-30 09:08:46 +08:00
|
|
|
to be <STRONG>attr_t</STRONG>, and adds <STRONG>const</STRONG> qualifiers. The format codes
|
2010-10-03 08:50:21 +08:00
|
|
|
<STRONG>2</STRONG> and <STRONG>3</STRONG> for <STRONG>slk_init()</STRONG> and the function <STRONG>slk_attr</STRONG> are spe-
|
2005-10-10 02:41:57 +08:00
|
|
|
cific to ncurses.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
2010-10-03 08:50:21 +08:00
|
|
|
<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>curs_re-</STRONG>
|
|
|
|
<STRONG><A HREF="curs_refresh.3x.html">fresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
|
2000-07-09 10:46:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-10 02:41:57 +08:00
|
|
|
<STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>
|
2000-07-09 10:46:08 +08:00
|
|
|
</PRE>
|
2015-02-15 09:42:27 +08:00
|
|
|
<div class="nav">
|
|
|
|
<ul>
|
|
|
|
<li><a href="#h2-NAME">NAME</a></li>
|
|
|
|
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
|
|
|
|
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
|
|
|
|
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
|
|
|
<li><a href="#h2-NOTES">NOTES</a></li>
|
|
|
|
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
|
|
|
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2000-07-09 10:46:08 +08:00
|
|
|
</BODY>
|
|
|
|
</HTML>
|