Content-type: text/html Man page of curs_pad

curs_pad

Section: C Library Functions (3)
Index Return to Main Contents
 

NAME

curs_pad, newpad, pechochar, pecho_wchar, pechowchar, pnoutrefresh, prefresh, subpad - Routines that create and display Curses pads  

SYNOPSIS

#include <curses.h>

WINDOW *newpad( int nlines, int ncols ); int pechochar( WINDOW *pad, chtype ch ); int pecho_wchar( WINDOW *pad, const cchar_t *wch ); int pechowchar( WINDOW *pad, chtype wch ); int pnoutrefresh( WINDOW *pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol ); int prefresh( WINDOW *pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol ); WINDOW *subpad( WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x );
 

LIBRARY

Curses Library (libcurses)
 

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows:

newpad, pnoutrefresh, prefresh:  XPG4, XPG4-UNIX

pechochar, pecho_wchar, subpad:  XPG4-UNIX

Refer to the standards(5) reference page for more information about industry standards and associated tags.
 

DESCRIPTION

The newpad routine creates and returns a pointer to a new pad data structure with the given number of lines, nlines, and columns, ncols. A pad is like a window, except that a pad is not necessarily associated with a viewable part of the screen. Applications should use a pad whenever they require a window larger than the terminal screen. Automatic refreshes of pads (for example, from scrolling or echoing of input) do not occur. Applications cannot call wrefresh with a pad as an argument; they must call prefresh or pnoutrefresh instead. Note that these routines require additional parameters to specify the part of the pad to be displayed and the location on the screen to be used for the display.

Using the specified number of lines, nlines, and columns, ncols, the subpad routine creates and returns a pointer to a specialized window (called a subpad) within a pad (called the parent pad). The subwin routine uses screen coordinates to create a subwindow; however, for subpad, the subpad is created at position (begin_x, begin_y) on the parent pad. A subpad must fit totally within its parent pad. Changes made made to either the parent pad or the subpad affect both. When applications use subpad to create a specialized window within a pad, they often have to call touchwin or touchline on the orig window before calling prefresh.

The prefresh and pnoutrefresh routines are analogous to wrefresh and wnoutrefresh except that prefresh and pnoutrefresh relate to pads instead of windows. The additional parameters in these routines indicate what part of the pad and screen are involved. The pminrow and pmincol parameters specify the upper left-hand corner of the rectangle to be displayed in the pad. The sminrow, smincol, smaxrow, and smaxcol parameters specify the edges of the rectangle to be displayed on the screen. The lower right-hand corner of the rectangle to be displayed in the pad is calculated from the screen coordinates, since the rectangles must be the same size. Both rectangles must be entirely contained within their respective structures. Negative values of pminrow, pmincol, sminrow, or smincol are treated as if they were zero.

The pechochar routine is functionally equivalent to a call to addch followed by a call to refresh, a call to waddch followed by a call to wrefresh, or a call to waddch followed by a call to prefresh.

[Compaq]  The pechowchar routine is functionally equivalent to a call to addwch followed by a call to refresh, a call to waddwch followed by a call to wrefresh, or a call to waddwch followed by a call to prefresh.

The pecho_wchar function outputs one character to a pad and immediately refreshes the pad. It is equivalent to a call to wadd_wch followed by a call to prefresh.

The pecho* routines take into consideration the fact that only a single character is being output and, for characters other than control characters, applications may realize a considerable performance gain by using these routines instead of their equivalents. For pechowchar and pecho_wchar, the last location of the pad on the screen is reused for arguments to prefresh.
 

NOTES

The header file <curses.h> automatically includes the header file <stdio.h>.

The pechowchar routine described on this reference page is among the MNLS Curses functions that are not included in the X/Open Curses CAE specification. MNLS routines are supported only for backward compatibility reasons. Compaq recommends the use of the pecho_wchar function in new applications.
 

RETURN VALUES

Routines that return an integer return ERR upon failure and an integer value other than ERR upon successful completion.

Routines that return pointers return NULL on error.
 

SEE ALSO

Functions: curses(3), curs_addch(3), curs_addwch(3), curs_refresh(3), curs_touch(3)

Others: standards(5)


 

Index

NAME
SYNOPSIS
LIBRARY
STANDARDS
DESCRIPTION
NOTES
RETURN VALUES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 02:40:54 GMT, October 02, 2010