HP 9000 Series 300 Tutorials Manual page 211

Device i/o and user interfacing hp-ux concepts and tutorials
Hide thumbs Also See for HP 9000 Series 300:
Table of Contents

Advertisement

Three other constants in <curses.
h>
are also useful:
• A_NORMAL
(value
=
000000000000) can be used as an argument for
attrset to disable all attributes. attrset
(A_NORMAL)
is equivalent to
attrset(O), but more descriptive.
• A_ATTRIBUTES
has an octal value of 037740000000. It can be used in
a bit-level logical AND to remove character bits and NLS attributes,
isolating the attributes attached to a given character.
• A_CHARTEXT
has an octal value of 000000000377. It is useful in a
bit-level logical AND to discard all except the lower eight bits of the
data word; in effect, separating the character from its highlighting
attributes.
curses maintains a set of current attributes for each window. Whenever text
is being placed in a given window by the program, the current attribute bits for
the selected window are added to each character of text data, forming a 32-bit
word for each character handled. To select a specific combination of attributes,
a program call to attrset (or attron) with new attribute values must precede
text output to the window. This can be used to enable one or more attributes
when all were previously disabled, disable all currently enabled attributes
(attrset(O)), or change the current set to any other new current set.
To enable one or more attributes in the current set without altering other
active or inactive attributes, call attron. A call to attroff performs the
opposite function, disabling the selected attributes without disturbing any
other attributes in the current set.
curses always uses current attribute values, so a call to attrset, attron, or
attroff (or their related window functions) must be used whenever you begin,
end, or change any selected highlighting option. Here is an example program
segment that illustrates how to set a word in boldface then restore normal
display attributes for remaining text:
printw(IIA word in II);
attrset(A_BOLD);
printw(lIboldface ll );
attrset(O);
printw(1I really stands out.\nll);
refreshO;
Using Curses and Terminfo
1-13

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents