-<!--
+<!--
****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_slk.3x,v 1.37 2020/12/30 18:37:43 tom Exp @
+ * @Id: curs_slk.3x,v 1.38 2021/06/17 21:26:02 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
-<TITLE>curs_slk 3x</TITLE>
+<TITLE>curs_slk 3X</TITLE>
<link rel="author" href="mailto:bug-ncurses@gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
-<H1 class="no-header">curs_slk 3x</H1>
+<H1 class="no-header">curs_slk 3X</H1>
<PRE>
-<STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG> <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>
+<B><A HREF="curs_slk.3X.html">curs_slk(3X)</A></B> <B><A HREF="curs_slk.3X.html">curs_slk(3X)</A></B>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>slk_init</STRONG>, <STRONG>slk_set</STRONG>, <STRONG>slk_wset</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>extended_slk_color</STRONG> - <STRONG>curses</STRONG> soft label routines
+ <B>slk_init</B>, <B>slk_set</B>, <B>slk_wset</B>, <B>slk_refresh</B>, <B>slk_noutrefresh</B>, <B>slk_label</B>,
+ <B>slk_clear</B>, <B>slk_restore</B>, <B>slk_touch</B>, <B>slk_attron</B>, <B>slk_attrset</B>,
+ <B>slk_attroff</B>, <B>slk_attr_on</B>, <B>slk_attr_set</B>, <B>slk_attr_off</B>, <B>slk_attr</B>,
+ <B>slk_color</B>, <B>extended_slk_color</B> - <B>curses</B> soft label routines
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
- <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
+ <B>#include</B> <B><curses.h></B>
- <STRONG>int</STRONG> <STRONG>slk_init(int</STRONG> <EM>fmt</EM><STRONG>);</STRONG>
+ <B>int</B> <B>slk_init(int</B> <I>fmt</I><B>);</B>
- <STRONG>int</STRONG> <STRONG>slk_set(int</STRONG> <EM>labnum</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>label</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>fmt</EM><STRONG>);</STRONG>
+ <B>int</B> <B>slk_set(int</B> <I>labnum</I><B>,</B> <B>const</B> <B>char</B> <B>*</B><I>label</I><B>,</B> <B>int</B> <I>fmt</I><B>);</B>
/* extension */
- <STRONG>int</STRONG> <STRONG>slk_wset(int</STRONG> <EM>labnum</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>label</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>fmt</EM><STRONG>);</STRONG>
+ <B>int</B> <B>slk_wset(int</B> <I>labnum</I><B>,</B> <B>const</B> <B>wchar_t</B> <B>*</B><I>label</I><B>,</B> <B>int</B> <I>fmt</I><B>);</B>
- <STRONG>char</STRONG> <STRONG>*slk_label(int</STRONG> <EM>labnum</EM><STRONG>);</STRONG>
+ <B>char</B> <B>*slk_label(int</B> <I>labnum</I><B>);</B>
- <STRONG>int</STRONG> <STRONG>slk_refresh(void);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_noutrefresh(void);</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>
+ <B>int</B> <B>slk_refresh(void);</B>
+ <B>int</B> <B>slk_noutrefresh(void);</B>
+ <B>int</B> <B>slk_clear(void);</B>
+ <B>int</B> <B>slk_restore(void);</B>
+ <B>int</B> <B>slk_touch(void);</B>
- <STRONG>int</STRONG> <STRONG>slk_attron(const</STRONG> <STRONG>chtype</STRONG> <EM>attrs</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_attroff(const</STRONG> <STRONG>chtype</STRONG> <EM>attrs</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_attrset(const</STRONG> <STRONG>chtype</STRONG> <EM>attrs</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_attr_on(attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void*</STRONG> <EM>opts</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_attr_off(const</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG> <EM>opts</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_attr_set(const</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>void*</STRONG> <EM>opts</EM><STRONG>);</STRONG>
+ <B>int</B> <B>slk_attron(const</B> <B>chtype</B> <I>attrs</I><B>);</B>
+ <B>int</B> <B>slk_attroff(const</B> <B>chtype</B> <I>attrs</I><B>);</B>
+ <B>int</B> <B>slk_attrset(const</B> <B>chtype</B> <I>attrs</I><B>);</B>
+ <B>int</B> <B>slk_attr_on(attr_t</B> <I>attrs</I><B>,</B> <B>void*</B> <I>opts</I><B>);</B>
+ <B>int</B> <B>slk_attr_off(const</B> <B>attr_t</B> <I>attrs</I><B>,</B> <B>void</B> <B>*</B> <I>opts</I><B>);</B>
+ <B>int</B> <B>slk_attr_set(const</B> <B>attr_t</B> <I>attrs</I><B>,</B> <B>short</B> <I>pair</I><B>,</B> <B>void*</B> <I>opts</I><B>);</B>
- <STRONG>attr_t</STRONG> <STRONG>slk_attr(void);</STRONG>
+ <B>attr_t</B> <B>slk_attr(void);</B>
- <STRONG>int</STRONG> <STRONG>slk_color(short</STRONG> <EM>pair</EM><STRONG>);</STRONG>
+ <B>int</B> <B>slk_color(short</B> <I>pair</I><B>);</B>
/* extension */
- <STRONG>int</STRONG> <STRONG>extended_slk_color(int</STRONG> <EM>pair</EM><STRONG>);</STRONG>
+ <B>int</B> <B>extended_slk_color(int</B> <I>pair</I><B>);</B>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></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 la-
- bels, <STRONG>curses</STRONG> takes over the bottom line of <STRONG>stdscr</STRONG>, reducing the size of
- <STRONG>stdscr</STRONG> and the variable <STRONG>LINES</STRONG>. <STRONG>curses</STRONG> standardizes on eight labels of
+ bels, <B>curses</B> takes over the bottom line of <B>stdscr</B>, reducing the size of
+ <B>stdscr</B> and the variable <B>LINES</B>. <B>curses</B> standardizes on eight labels of
up to eight characters each. In addition to this, the ncurses imple-
mentation supports a mode where it simulates 12 labels of up to five
characters each. This is useful for PC-like enduser devices. ncurses
</PRE><H3><a name="h3-Initialization">Initialization</a></H3><PRE>
- 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
+ The <B>slk_init</B> routine must be called before <B>initscr</B> or <B>newterm</B> is
+ called. If <B>initscr</B> eventually uses a line from <B>stdscr</B> to emulate the
+ soft labels, then <I>fmt</I> determines how the labels are arranged on the
screen:
- <STRONG>0</STRONG> indicates a 3-2-3 arrangement of the labels.
+ <B>0</B> indicates a 3-2-3 arrangement of the labels.
- <STRONG>1</STRONG> indicates a 4-4 arrangement
+ <B>1</B> indicates a 4-4 arrangement
- <STRONG>2</STRONG> indicates the PC-like 4-4-4 mode.
+ <B>2</B> indicates the PC-like 4-4-4 mode.
- <STRONG>3</STRONG> is again the PC-like 4-4-4 mode, but in addition an index line is
+ <B>3</B> 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.
</PRE><H3><a name="h3-Labels">Labels</a></H3><PRE>
- The <STRONG>slk_set</STRONG> routine (and the <STRONG>slk_wset</STRONG> routine for the wide-character
+ The <B>slk_set</B> routine (and the <B>slk_wset</B> routine for the wide-character
library) has three parameters:
- <EM>labnum</EM>
- is the label number, from <STRONG>1</STRONG> to <STRONG>8</STRONG> (12 for <EM>fmt</EM> in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG>
- or <STRONG>3</STRONG>);
+ <I>labnum</I>
+ is the label number, from <B>1</B> to <B>8</B> (12 for <I>fmt</I> in <B>slk_init</B> is <B>2</B>
+ or <B>3</B>);
- <EM>label</EM>
- 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>) characters in length. A null string or
+ <I>label</I>
+ is be the string to put on the label, up to eight (five for <I>fmt</I>
+ in <B>slk_init</B> is <B>2</B> or <B>3</B>) 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
+ <I>fmt</I> is either <B>0</B>, <B>1</B>, or <B>2</B>, indicating whether the label is to be
left-justified, centered, or right-justified, respectively,
within the label.
- The <STRONG>slk_label</STRONG> routine returns the current label for label number <EM>lab-</EM>
- <EM>num</EM>, with leading and trailing blanks stripped.
+ The <B>slk_label</B> routine returns the current label for label number <I>lab-</I>
+ <I>num</I>, with leading and trailing blanks stripped.
</PRE><H3><a name="h3-Screen-updates">Screen updates</a></H3><PRE>
- The <STRONG>slk_refresh</STRONG> and <STRONG>slk_noutrefresh</STRONG> routines correspond to the <STRONG>wrefresh</STRONG>
- and <STRONG>wnoutrefresh</STRONG> routines.
+ The <B>slk_refresh</B> and <B>slk_noutrefresh</B> routines correspond to the <B>wrefresh</B>
+ and <B>wnoutrefresh</B> routines.
- The <STRONG>slk_clear</STRONG> routine clears the soft labels from the screen.
+ The <B>slk_clear</B> 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 <B>slk_restore</B> routine restores the soft labels to the screen after a
+ <B>slk_clear</B> 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 <B>slk_touch</B> routine forces all the soft labels to be output the next
+ time a <B>slk_noutrefresh</B> is performed.
</PRE><H3><a name="h3-Video-attributes">Video attributes</a></H3><PRE>
- The <STRONG>slk_attron</STRONG>, <STRONG>slk_attrset</STRONG>, <STRONG>slk_attroff</STRONG> and <STRONG>slk_attr</STRONG> routines corre-
- spond to <STRONG>attron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>attroff</STRONG> and <STRONG>attr_get</STRONG>, respectively. They
+ The <B>slk_attron</B>, <B>slk_attrset</B>, <B>slk_attroff</B> and <B>slk_attr</B> routines corre-
+ spond to <B>attron</B>, <B>attrset</B>, <B>attroff</B> and <B>attr_get</B>, respectively. 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).
</PRE><H3><a name="h3-Colors">Colors</a></H3><PRE>
- The <STRONG>slk_color</STRONG> routine corresponds to <STRONG>color_set</STRONG>. It has an effect only
+ The <B>slk_color</B> routine corresponds to <B>color_set</B>. It has an effect only
if soft labels are simulated on the bottom line of the screen.
- Because <STRONG>slk_color</STRONG> accepts only <STRONG>short</STRONG> (signed 16-bit integer) values,
- this implementation provides <STRONG>extended_slk_color</STRONG> which accepts an inte-
+ Because <B>slk_color</B> accepts only <B>short</B> (signed 16-bit integer) values,
+ this implementation provides <B>extended_slk_color</B> which accepts an inte-
ger value, e.g., 32-bits.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- These routines return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4 specifies only "an
- integer value other than <STRONG>ERR</STRONG>") upon successful completion.
+ These routines return <B>ERR</B> upon failure and <B>OK</B> (SVr4 specifies only "an
+ integer value other than <B>ERR</B>") upon successful completion.
X/Open defines no error conditions. In this implementation
- <STRONG>slk_attr</STRONG>
+ <B>slk_attr</B>
returns the attribute used for the soft keys.
- <STRONG>slk_attroff</STRONG>, <STRONG>slk_attron</STRONG>, <STRONG>slk_clear</STRONG>, <STRONG>slk_noutrefresh</STRONG>, <STRONG>slk_refresh</STRONG>,
- <STRONG>slk_touch</STRONG>
+ <B>slk_attroff</B>, <B>slk_attron</B>, <B>slk_clear</B>, <B>slk_noutrefresh</B>, <B>slk_refresh</B>,
+ <B>slk_touch</B>
return an error if the terminal or the softkeys were not ini-
tialized.
- <STRONG>slk_attrset</STRONG>
+ <B>slk_attrset</B>
returns an error if the terminal or the softkeys were not ini-
tialized.
- <STRONG>slk_attr_set</STRONG>
+ <B>slk_attr_set</B>
returns an error if the terminal or the softkeys were not ini-
tialized, or the color pair is outside the range 0..COL-
OR_PAIRS-1.
- <STRONG>slk_color</STRONG>
+ <B>slk_color</B>
returns an error if the terminal or the softkeys were not ini-
tialized, or the color pair is outside the range 0..COL-
OR_PAIRS-1.
- <STRONG>slk_init</STRONG>
+ <B>slk_init</B>
returns an error if the format parameter is outside the range
0..3.
- <STRONG>slk_label</STRONG>
- returns <STRONG>NULL</STRONG> on error.
+ <B>slk_label</B>
+ returns <B>NULL</B> on error.
- <STRONG>slk_set</STRONG>
+ <B>slk_set</B>
returns an error if the terminal or the softkeys were not ini-
- tialized, or the <EM>labnum</EM> parameter is outside the range of label
+ tialized, or the <I>labnum</I> parameter is outside the range of label
counts, or if the format parameter is outside the range 0..2,
or if memory for the labels cannot be allocated.
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
- X/Open Curses documents the <EM>opts</EM> argument as reserved for future use,
+ X/Open Curses documents the <I>opts</I> argument as reserved for future use,
saying that it must be null. This implementation uses that parameter
in ABI 6 for the functions which have a color-pair parameter to support
extended color pairs.
- For functions which modify the color, e.g., <STRONG>slk_attr_set</STRONG>, if <EM>opts</EM> is
- set it is treated as a pointer to <STRONG>int</STRONG>, and used to set the color
- pair instead of the <STRONG>short</STRONG> pair parameter.
+ For functions which modify the color, e.g., <B>slk_attr_set</B>, if <I>opts</I> is
+ set it is treated as a pointer to <B>int</B>, and used to set the color
+ pair instead of the <B>short</B> pair parameter.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- Most applications would use <STRONG>slk_noutrefresh</STRONG> because a <STRONG>wrefresh</STRONG> is like-
+ Most applications would use <B>slk_noutrefresh</B> because a <B>wrefresh</B> is like-
ly to follow soon.
The XSI Curses standard, Issue 4, described the soft-key functions,
with some differences from SVr4 curses:
- <STRONG>o</STRONG> It added functions like the SVr4 attribute-manipulation functions
- <STRONG>slk_attron</STRONG>, <STRONG>slk_attroff</STRONG>, <STRONG>slk_attrset</STRONG>, but which use <STRONG>attr_t</STRONG> parame-
- ters (rather than <STRONG>chtype</STRONG>), along with a reserved <EM>opts</EM> parameter.
+ <B>o</B> It added functions like the SVr4 attribute-manipulation functions
+ <B>slk_attron</B>, <B>slk_attroff</B>, <B>slk_attrset</B>, but which use <B>attr_t</B> parame-
+ ters (rather than <B>chtype</B>), along with a reserved <I>opts</I> parameter.
Two of these new functions (unlike the SVr4 functions) have no pro-
- vision for color: <STRONG>slk_attr_on</STRONG> and <STRONG>slk_attr_off</STRONG>.
+ vision for color: <B>slk_attr_on</B> and <B>slk_attr_off</B>.
- The third function (<STRONG>slk_attr_set</STRONG>) has a color-pair parameter.
+ The third function (<B>slk_attr_set</B>) has a color-pair parameter.
- <STRONG>o</STRONG> It added <STRONG>const</STRONG> qualifiers to parameters (unnecessarily), and
+ <B>o</B> It added <B>const</B> qualifiers to parameters (unnecessarily), and
- <STRONG>o</STRONG> It added <STRONG>slk_color</STRONG>.
+ <B>o</B> It added <B>slk_color</B>.
- The format codes <STRONG>2</STRONG> and <STRONG>3</STRONG> for <STRONG>slk_init</STRONG> and the function <STRONG>slk_attr</STRONG> are
+ The format codes <B>2</B> and <B>3</B> for <B>slk_init</B> and the function <B>slk_attr</B> are
specific to ncurses.
X/Open Curses does not specify a limit for the number of colors and
- color pairs which a terminal can support. However, in its use of <STRONG>short</STRONG>
+ color pairs which a terminal can support. However, in its use of <B>short</B>
for the parameters, it carries over SVr4's implementation detail for
the compiled terminfo database, which uses signed 16-bit numbers. This
implementation provides extended versions of those functions which use
- <STRONG>short</STRONG> parameters, allowing applications to use larger color- and pair-
+ <B>short</B> parameters, allowing applications to use larger color- and pair-
numbers.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></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>,
- <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
+ <B><A HREF="curses.3X.html">curses(3X)</A></B>, <B><A HREF="curs_attr.3X.html">curs_attr(3X)</A></B>, <B><A HREF="curs_initscr.3X.html">curs_initscr(3X)</A></B>, <B><A HREF="curs_refresh.3X.html">curs_refresh(3X)</A></B>,
+ <B><A HREF="curs_variables.3X.html">curs_variables(3X)</A></B>.
- <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>
+ <B><A HREF="curs_slk.3X.html">curs_slk(3X)</A></B>
</PRE>
<div class="nav">
<ul>