[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

vidattr, vid_attr, vidputs, or vid_puts Subroutine

Purpose

Outputs attributes to the terminal.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

int vidattr
(chtype attr);

int vid_attr
(attr_t attr,
short color_pair_number,
void *opt);

int vidputs
(chtype attr,
int (*putfunc)(int));

int vid_puts
(attr_t attr,
short color_pair_number,
void *opt,
int (*putfunc)(int));

Description

These subroutines output commands to a terminal that changes the terminal's attributes.

If the terminfo database indicates that the terminal in use can display characters in the rendition specified by attr, then the vadattr subroutine outputs one or more commands to request that the terminal display subsequent characters in that rendition. The subroutine outputs by calling the putchar subroutine. The vidattr subroutine neither relies on nor updates the model that Curses maintains of the prior rendition mode.

The vidputs subroutine computes the same terminal output string that vidattr does, based on attr, but the vidputs subroutine outputs by calling the user-supplied subroutine putfunc. The vid_attr and vid_puts subroutines correspond to vidattr and vidputs respectively, but take a set of arguments, one of type attr_t for the attributes, short for the color pair number and a void *, and thus support the attribute constants with the WA_prefix.

The opts argument is reserved for definition in a future edition of this document. Currently, the application must provide a null pointer as opts.

The user-supplied putfunc subroutine (which can be specified as an argument to either vidputs or vid_puts is either putchar or some other subroutine with the same prototype. Both the vidputs and the vid_puts subroutines ignore the return value of putfunc.

Parameters

att  
color_pair_number  
*opt  
*putfunc  

Return Values

Upon successful completion, these subroutines return OK. Otherwise, they return ERR.

Examples

  1. To output the string that puts the terminal in its best standout mode through the putchar subroutine, enter

    vidattr(A_STANDOUT);
  2. To output the string that puts the terminal in its best standout mode through the putchar-like subroutine my_putc, enter
    int (*my_putc) ();
    vidputs(A_STANDOUT, my_putc);

Related Information

The doupdate (doupdate, refresh, wnoutrefresh, or wrefresh Subroutines), is_linetouched (is_linetouched, is_wintouched, touchline, touchwin, untouchwin, or wtouchin Subroutine), putchar, putwchar and tigetflag (tigetflag, tigetnum, tigetstr, or tparm Subroutine) subroutines.

Curses Overview for Programming in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

List of Curses Subroutines in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

Setting Video Attributes and Curses Options in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]