attroff, attron, attrset, wattroff, wattron, or wattrset Subroutine

Purpose

Restricted window attribute control functions.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

 

int attroff (int *attrs);

 

int attron (int *attrs);

 

int attrset (int *attrs);

 

int wattroff (WINDOW *win, int *attsr);

 

int wattron (WINDOW *win, int *attrs);

 

int wattrset (WINDOW *win, int *attsr);

Description

These subroutines manipulate the window attributes of the current or specified window.

The attroff and wattroff subroutines turn off attrs in the current or specified specified window without affecting any others.

The attron and wattron subroutines turn on attrs in the current or specified specified window without affecting any others.

The attrset and wattrset subroutines set the background attributes of the current or specified specified window to attrs.

It unspecified whether these subroutines can be used to manipulate attributes than A_BLINK, A_BOLD, A_DIM, A_REVERSE, A_STANDOUT and A_UNDERLINE.

Parameters

Item Description
*attrs Specifies which attributes to turn off.
*win Specifies the window in which to turn off the specified attributes.

Return Values

These subroutines always return either OK or 1.

Examples

For the attroff or wattroff subroutines:

  1. To turn the off underlining attribute in stdscr, enter:
    attroff(A_UNDERLINE);
  2. To turn off the underlining attribute in the user-defined window my_window, enter:
    wattroff(my_window, A_UNDERLINE);

For the attron or wattron subroutines:

  1. To turn on the underlining attribute in stdscr, enter:
    attron(A_UNDERLINE);
  2. To turn on the underlining attribute in the user-defined window my_window, enter:
    wattron(my_window, A_UNDERLINE);

For the attrset or wattrset subroutines:

  1. To set the current attribute in the stdscr global variable to blink, enter:
    attrset(A_BLINK);
  2. To set the current attribute in the user-defined window my_window to blinking, enter:
    wattrset(my_window, A_BLINK);
  3. To turn off all attributes in the stdscr global variable, enter:
    attrset(0);
  4. To turn off all attributes in the user-defined window my_window, enter:
    wattrset(my_window, 0);