These functions manipulate attributes on
stdscr or on the specified window. The attributes that can be manipulated are:
A_NORMAL
no special attributes are applied
A_STANDOUT
characters are displayed in standout mode
A_UNDERLINE
characters are displayed underlined
A_REVERSE
characters are displayed in inverse video
A_DIM
characters are displayed at a lower intensity
A_BOLD
characters are displayed at a higher intensity
A_INVIS
characters are added invisibly
A_PROTECT
characters are protected from modification
A_ALTCHARSET
characters are displayed using the alternate character set (ACS)
COLOR_PAIR(n)
characters are displayed using color pair n.
The
attron() function turns on the attributes specified in
attr on
stdscr, while the
attroff() function turns off the attributes specified in
attr on
stdscr.
The function
attrset() sets the attributes of
stdscr to those specified in
attr, turning off any others. To turn off all the attributes (including color and alternate character set), use
attrset(
A_NORMAL).
Multiple attributes can be manipulated by combining the attributes using a logical
OR. For example,
attron(
A_REVERSE | A_BOLD) will turn on both inverse video and higher intensity.
The function
color_set() sets the color pair attribute to the pair specified in
pair.
The function
getattrs() returns the attributes that are currently applied to window specified by
win.
The function
termattrs() returns the logical
OR of attributes that can be applied to the screen.
The functions
wattron(),
wattroff(),
wattrset(), and
wcolor_set() are equivalent to
attron(),
attroff()
attrset(), and
color_set() respectively, excepting that the attributes are applied to the window specified by
win.
The following functions additionally manipulate wide attributes on
stdscr or on the specified window. The additional wide attributes that can be manipulated are:
WA_STANDOUT
characters are displayed in standout mode
WA_UNDERLINE
characters are displayed underlined
WA_REVERSE
characters are displayed in inverse video
WA_BLINK
characters blink
WA_DIM
characters are displayed at a lower intensity
WA_BOLD
characters are displayed at a higher intensity
WA_INVIS
characters are added invisibly
WA_PROTECT
characters are protected from modification
WA_ALTCHARSET
characters are displayed using the alternate character set (ACS)
WA_LOW
characters are displayed with low highlight
WA_TOP
characters are displayed with top highlight
WA_HORIZONTAL
characters are displayed with horizontal highlight
WA_VERTICAL
characters are displayed with vertical highlight
WA_LEFT
characters are displayed with left highlight
WA_RIGHT
characters are displayed with right highlight
The
attr_on() function turns on the wide attributes specified in
attr on
stdscr, while the
attr_off() function turns off the wide attributes specified in
attr on
stdscr.
The function
attr_set() sets the wide attributes of
stdscr to those specified in
attr and
pair, turning off any others. Note that a color pair specified in
pair will override any color pair specified in
attr.
The function
attr_get() sets
attr to the wide attributes and
pair to the color pair currently applied to
stdscr. Either of
attr and
pair can be
NULL, if the relevant value is of no interest.
The function
term_attrs() returns the logical
OR of wide attributes that can be applied to the screen.
The functions
wattr_on(),
wattr_off() and
wattr_set() are equivalent to
attr_on(),
attr_off() and
attr_set() respectively, excepting that the character is added to the window specified by
win.
The function
wattr_get() is equivalent to
attr_get(), excepting that the wide attributes and color pair currently applied to
win are set.
The following constants can be used to extract the components of a
chtype:
A_ATTRIBUTES
bit-mask containing attributes part
A_CHARTEXT
bit-mask containing character part
A_COLOR
bit-mask containing color-pair part