HPlogo MPE/iX Developer's Kit Reference Manual Volume 2: HP 3000 MPE/iX Computer Systems > Chapter 4 CURSES

attroff wattroff attron wattron attrset wattrset standend wstandend standout wstandout

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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 “Constant Values for Highlighting Attributes” are defined in curses.h and can be combined with the bitwise OR operator.

Table 4-4 Constant Values for Highlighting Attributes

ConstantDescription
A_ALTCHARSETAlternate character set
A_ATTRIBUTESAttribute mask
A_BLINKBlinking
A_BOLDBold
A_CHARTEXTCharacter mask
A_COLORColor mask
A_DIMDim
A_INVISInvisible
A_NORMALDisable attributes
A_PROTECT No display
A_REVERSE Reverse video
A_STANDOUT Highlights specific to terminal
A_UNDERLINEUnderline
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

Feedback to webmaster