attroff, wattroff, attron, wattron, attrset, wattrset, standend, [ MPE/iX Developer's Kit Reference Manual Volume II ] MPE/iX 5.0 Documentation
MPE/iX Developer's Kit Reference Manual Volume II
attroff, wattroff, attron, wattron, attrset, wattrset, standend,
wstandend, standout, wstandout
The attroff set of routines is used to change the foreground window
attributes.
Syntax
#include <curses.h>
int attroff(chtype attrs);
int wattroff(WINDOW *win, chtype attrs);
int attron(chtype attrs);
int wattron(WINDOW *win, chtype attrs);
int attrset(chtype attrs);
int wattrset(WINDOW *win, chtype attrs);
int standend();
int wstandend(WINDOW *win);
int standout();
int wstandout(WINDOW *win);
Parameters
attrs The foreground window attributes to be added or
removed.
win A pointer to the window in which attribute changes
are to be made.
Return Values
OK Successful completion.
ERR An error occurred.
Description
The attroff() and attron() routines remove and add, respectively, the
specified foreground window attributes of stdscr. These routines only
affect the attributes specified; attributes that existed before the call
retain their values. The wattroff() and wattron() routines remove or add
the specified attributes for window win.
The attrset() and wattrset() routines change the specified foreground
window attributes of stdscr and win to new values; the old values are not
retained.
The attributes shown in Table 4-4 are defined in curses.h and can be
combined with the bitwise OR operator.
Table 4-4. Constant Values for Highlighting Attributes
---------------------------------------------------------------------------------------------
| | |
| Constant | Description |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_ALTCHARSET | Alternate character set |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_ATTRIBUTES | Attribute mask |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_BLINK | Blinking |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_BOLD | Bold |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_CHARTEXT | Character mask |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_COLOR | Color mask |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_DIM | Dim |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_INVIS | Invisible |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_NORMAL | Disable attributes |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_PROTECT | No display |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_REVERSE | Reverse video |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_STANDOUT | Highlights specific to terminal |
| | |
---------------------------------------------------------------------------------------------
| | |
| A_UNDERLINE | Underline |
| | |
---------------------------------------------------------------------------------------------
| | |
| COLOR_PAIR(n) | Color-pair number n |
| | |
---------------------------------------------------------------------------------------------
| | |
| PAIR_NUMBER(a) | Pair number for COLOR_PAIR(n) |
| | |
---------------------------------------------------------------------------------------------
The standend() routine is equivalent to attrset(A_NORMAL). Similarly, the
wstandend() routine is equivalent to wattrset(win, A_NORMAL).
The standout() and wstandout() routines are equivalent to
attron(A_STANDOUT) and wattron(win, A_STANDOUT), respectively.
CURSES applies the current foreground attributes when writing characters
to a window with the waddch(), waddstr(), or wprintw() routines.
The following example prints some text using the current foreground
attributes, adds underlining, changes the attributes, prints more text,
then changes the attributes back.
printw("This word is");
attrset(A_UNDERLINE);
printw("underlined.");
attrset(A_NORMAL);
printw("This is back to normal text.\n");
refresh();
NOTE All of these routines are macros.
Implementation Considerations
Identical to XPG/3 except for color support
See Also
init_color(), init_pair(), start_color(), wbkgd(), wbkgdset()
Portability
HP-UX, UNIX System V, XPG/3
MPE/iX 5.0 Documentation