4 <!-- Manpage converted by man2html 3.0.1 -->
8 <B>attroff</B>, <B>wattroff</B>, <B>attron</B>, <B>wattron</B>, <B>attrset</B>, <B>wattrset</B>,
9 <B>color_set</B>, <B>wcolor_set</B>, <B>standend</B>, <B>wstandend</B>, <B>standout</B>,
10 <B>wstandout</B>, <B>attr_get</B>, <B>wattr_get</B>, <B>attr_off</B>, <B>wattr_off</B>,
11 <B>attr_on</B>, <B>wattr_on</B>, <B>attr_set</B>, <B>wattr_set</B>, <B>chgat</B>, <B>wchgat</B>,
12 <B>mvchgat</B>, <B>mvwchgat</B>, <B>PAIR_NUMBER</B> - <B>curses</B> character and win-
13 dow attribute control routines
17 <H2>SYNOPSIS</H2><PRE>
18 <B>#include</B> <B><curses.h></B>
19 <B>int</B> <B>attroff(int</B> <B>attrs);</B>
20 <B>int</B> <B>wattroff(WINDOW</B> <B>*win,</B> <B>int</B> <B>attrs);</B>
21 <B>int</B> <B>attron(int</B> <B>attrs);</B>
22 <B>int</B> <B>wattron(WINDOW</B> <B>*win,</B> <B>int</B> <B>attrs);</B>
23 <B>int</B> <B>attrset(int</B> <B>attrs);</B>
24 <B>int</B> <B>wattrset(WINDOW</B> <B>*win,</B> <B>int</B> <B>attrs);</B>
25 <B>int</B> <B>color_set(short</B> <B>color_pair_number,</B> <B>void*</B> <B>opts);</B>
26 <B>int</B> <B>wcolor_set(WINDOW</B> <B>*win,</B> <B>short</B> <B>color_pair_number,</B>
27 <B>void*</B> <B>opts);</B>
28 <B>int</B> <B>standend(void);</B>
29 <B>int</B> <B>wstandend(WINDOW</B> <B>*win);</B>
30 <B>int</B> <B>standout(void);</B>
31 <B>int</B> <B>wstandout(WINDOW</B> <B>*win);</B>
32 <B>int</B> <B>attr_get(attr_t</B> <B>*attrs,</B> <B>short</B> <B>*pair,</B> <B>void</B> <B>*opts);</B>
33 <B>int</B> <B>wattr_get(WINDOW</B> <B>*win,</B> <B>attr_t</B> <B>*attrs,</B> <B>short</B> <B>*pair,</B>
34 <B>void</B> <B>*opts);</B>
35 <B>int</B> <B>attr_off(attr_t</B> <B>attrs,</B> <B>void</B> <B>*opts);</B>
36 <B>int</B> <B>wattr_off(WINDOW</B> <B>*win,</B> <B>attr_t</B> <B>attrs,</B> <B>void</B> <B>*opts);</B>
37 <B>int</B> <B>attr_on(attr_t</B> <B>attrs,</B> <B>void</B> <B>*opts);</B>
38 <B>int</B> <B>wattr_on(WINDOW</B> <B>*win,</B> <B>attr_t</B> <B>attrs,</B> <B>void</B> <B>*opts);</B>
39 <B>int</B> <B>attr_set(attr_t</B> <B>attrs,</B> <B>short</B> <B>pair,</B> <B>void</B> <B>*opts);</B>
40 <B>int</B> <B>wattr_set(WINDOW</B> <B>*win,</B> <B>attr_t</B> <B>attrs,</B> <B>short</B> <B>pair,</B> <B>void</B>
42 <B>int</B> <B>chgat(int</B> <B>n,</B> <B>attr_t</B> <B>attr,</B> <B>short</B> <B>color,</B>
43 <B>const</B> <B>void</B> <B>*opts)</B>
44 <B>int</B> <B>wchgat(WINDOW</B> <B>*win,</B> <B>int</B> <B>n,</B> <B>attr_t</B> <B>attr,</B>
45 <B>short</B> <B>color,</B> <B>const</B> <B>void</B> <B>*opts)</B>
46 <B>int</B> <B>mvchgat(int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>int</B> <B>n,</B> <B>attr_t</B> <B>attr,</B>
47 <B>short</B> <B>color,</B> <B>const</B> <B>void</B> <B>*opts)</B>
48 <B>int</B> <B>mvwchgat(WINDOW</B> <B>*win,</B> <B>int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>int</B> <B>n,</B>
49 <B>attr_t</B> <B>attr,</B> <B>short</B> <B>color,</B> <B>const</B> <B>void</B> <B>*opts)</B>
53 <H2>DESCRIPTION</H2><PRE>
54 These routines manipulate the current attributes of the
55 named window. The current attributes of a window apply to
56 all characters that are written into the window with <B>wad-</B>
57 <B>dch</B>, <B>waddstr</B> and <B>wprintw</B>. Attributes are a property of
58 the character, and move with the character through any
59 scrolling and insert/delete line/character operations. To
60 the extent possible, they are displayed as appropriate
61 modifications to the graphic rendition of characters put
64 The routine <B>attrset</B> sets the current attributes of the
65 given window to <I>attrs</I>. The routine <B>attroff</B> turns off the
66 named attributes without turning any other attributes on
67 or off. The routine <B>attron</B> turns on the named attributes
68 without affecting any others. The routine <B>standout</B> is the
69 same as <B>attron(A_STANDOUT)</B>. The routine <B>standend</B> is the
70 same as <B>attrset(A_NORMAL)</B> or <B>attrset(0)</B>, that is, it turns
73 The routine <B>color_set</B> sets the current color of the given
74 window to the foreground/background combination described
75 by the color_pair_number. The parameter opts is reserved
76 for future use, applications must supply a null pointer.
78 The routine <B>wattr_get</B> returns the current attribute and
79 color pair for the given window; <B>attr_get</B> returns the cur-
80 rent attribute and color pair for <B>stdscr</B>. The remaining
81 <B>attr_</B>* functions operate exactly like the corresponding
82 <B>attr</B>* functions, except that they take arguments of type
83 <B>attr_t</B> rather than <B>int</B>.
85 The routine <B>chgat</B> changes the attributes of a given number
86 of characters starting at the current cursor location of
87 <B>stdscr</B>. It does not update the cursor and does not per-
88 form wrapping. A character count of -1 or greater than
89 the remaining window width means to change attributes all
90 the way to the end of the current line. The <B>wchgat</B> func-
91 tion generalizes this to any window; the <B>mvwchgat</B> function
92 does a cursor move before acting. In these functions, the
93 color argument is a color-pair index (as in the first
94 argument of <I>init</I><B>_</B><I>pair</I>, see <B><A HREF="curs_color.3x.html">curs_color(3x)</A></B>). The <B>opts</B>
95 argument is not presently used, but is reserved for the
96 future (leave it <B>NULL</B>).
99 The following video attributes, defined in <B><curses.h></B>, can
100 be passed to the routines <B>attron</B>, <B>attroff</B>, and <B>attrset</B>, or
101 OR'ed with the characters passed to <B>addch</B>.
103 <B>A_NORMAL</B> Normal display (no highlight)
104 <B>A_STANDOUT</B> Best highlighting mode of the terminal.
105 <B>A_UNDERLINE</B> Underlining
106 <B>A_REVERSE</B> Reverse video
107 <B>A_BLINK</B> Blinking
108 <B>A_DIM</B> Half bright
109 <B>A_BOLD</B> Extra bright or bold
110 <B>A_PROTECT</B> Protected mode
111 <B>A_INVIS</B> Invisible or blank mode
112 <B>A_ALTCHARSET</B> Alternate character set
113 <B>A_CHARTEXT</B> Bit-mask to extract a character
114 <B>COLOR_PAIR(</B><I>n</I><B>)</B> Color-pair number <I>n</I>
116 The following macro is the reverse of <B>COLOR_PAIR(</B><I>n</I><B>)</B>:
118 <B>PAIR_NUMBER(</B><I>attrs</I>) Returns the pair number associated
119 with the <B>COLOR_PAIR(</B><I>n</I><B>)</B> attribute.
121 The return values of many of these routines are not mean-
122 ingful (they are implemented as macro-expanded assignments
123 and simply return their argument). The SVr4 manual page
124 claims (falsely) that these routines always return <B>1</B>.
130 Note that <B>attroff</B>, <B>wattroff</B>, <B>attron</B>, <B>wattron</B>, <B>attrset</B>,
131 <B>wattrset</B>, <B>standend</B> and <B>standout</B> may be macros.
135 <H2>PORTABILITY</H2><PRE>
136 All these functions are supported in the XSI Curses stan-
137 dard, Issue 4. The standard defined the dedicated type
138 for highlights, <B>attr_t</B>, which is not defined in SVr4
139 curses. The functions taking <B>attr_t</B> arguments are not sup-
142 The XSI Curses standard states that whether the tradi-
143 tional functions <B>attron</B>/<B>attroff</B>/<B>attrset</B> can manipulate
144 attributes other than <B>A_BLINK</B>, <B>A_BOLD</B>, <B>A_DIM</B>, <B>A_REVERSE</B>,
145 <B>A_STANDOUT</B>, or <B>A_UNDERLINE</B> is "unspecified". Under this
146 implementation as well as SVr4 curses, these functions
147 correctly manipulate all other highlights (specifically,
148 <B>A_ALTCHARSET</B>, <B>A_PROTECT</B>, and <B>A_INVIS</B>).
150 XSI Curses added the new entry points, <B>attr_get</B>, <B>attr_on</B>,
151 <B>attr_off</B>, <B>attr_set</B>, <B>wattr_on</B>, <B>wattr_off</B>, <B>wattr_get</B>,
152 <B>wattr_set</B>. These are intended to work with a new series
153 of highlight macros prefixed with <B>WA_</B>.
155 <B>WA_NORMAL</B> Normal display (no highlight)
156 <B>WA_STANDOUT</B> Best highlighting mode of the terminal.
157 <B>WA_UNDERLINE</B> Underlining
158 <B>WA_REVERSE</B> Reverse video
159 <B>WA_BLINK</B> Blinking
160 <B>WA_DIM</B> Half bright
161 <B>WA_BOLD</B> Extra bright or bold
162 <B>WA_ALTCHARSET</B> Alternate character set
164 The XSI curses standard specifies that each pair of corre-
165 sponding <B>A_</B> and <B>WA_</B>-using functions operates on the same
166 current-highlight information.
168 The XSI standard extended conformance level adds new high-
169 lights <B>A_HORIZONTAL</B>, <B>A_LEFT</B>, <B>A_LOW</B>, <B>A_RIGHT</B>, <B>A_TOP</B>, <B>A_VER-</B>
170 <B>TICAL</B> (and corresponding <B>WA_</B> macros for each) which this
171 curses does not yet support.
175 <H2>SEE ALSO</H2><PRE>
176 <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="curs_addch.3x.html">curs_addch(3x)</A></B>, <B><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></B>,
177 <B><A HREF="curs_printw.3x.html">curs_printw(3x)</A></B>
182 Man(1) output converted with
183 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>