1curs_pad(3CURSES)          Curses Library Functions          curs_pad(3CURSES)
2
3
4

NAME

6       curs_pad, newpad, subpad, prefresh, pnoutrefresh, pechochar, pechowchar
7       - create and display curses pads
8

SYNOPSIS

10       cc [ flag ... ] file ... -lcurses [ library .. ]
11       #include <curses.h>
12
13       WINDOW *newpad(int nlines, int ncols);
14
15
16       WINDOW *subpad(WINDOW *orig, int nlines, int ncols, int begin_y,
17            int begin_x);
18
19
20       int prefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow,
21            int smincol, int smaxrow, int smaxcol);
22
23
24       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow,
25            int smincol, int smaxrow, int smaxcol);
26
27
28       int pechochar(WINDOW *pad, chtype ch);
29
30
31       int pechowchar(WINDOW *pad, chtype wch);
32
33

DESCRIPTION

35       The newpad() routine creates and returns a pointer to a  new  pad  data
36       structure with the given number of lines, nlines, and columns, ncols. A
37       pad is like a window, except that it is not restricted  by  the  screen
38       size,  and  is not necessarily associated with a particular part of the
39       screen. Pads can be used when a large window is needed, and only a part
40       of the window will be on the screen at one time. Automatic refreshes of
41       pads (for example, from scrolling or echoing of input) do not occur. It
42       is  not  legal to call wrefresh(3CURSES) with a pad as an argument; the
43       routines  prefresh() or pnoutrefresh() should be called  instead.  Note
44       that  these  routines require additional parameters to specify the part
45       of the pad to be displayed and the location on the screen  to  be  used
46       for the display.
47
48
49       The  subpad()  routine  creates  and  returns  a pointer to a subwindow
50       within a pad with the given  number  of  lines,  nlines,  and  columns,
51       ncols.  Unlike subwin(3CURSES), which uses screen coordinates, the win‐
52       dow is at position (begin_x, begin_y) on the pad. The window is made in
53       the  middle  of  the  window  orig,  so that changes made to one window
54       affect both windows. During the use of this routine, it will  often  be
55       necessary  to  call  touchwin(3CURSES)  or  touchline(3CURSES)  on orig
56       before calling prefresh().
57
58
59       The prefresh()  and  pnoutrefresh()  routines  are  analogous  to  wre‐
60       fresh(3CURSES)  and  wnoutrefresh(3CURSES)  except  that they relate to
61       pads instead of windows. The additional parameters are needed to  indi‐
62       cate  what part of the pad and screen are involved. pminrow and pmincol
63       specify the upper left-hand corner of the rectangle to be displayed  in
64       the  pad.  sminrow, smincol, smaxrow, and smaxcol  specify the edges of
65       the rectangle to be displayed on the screen. The lower right-hand  cor‐
66       ner  of the rectangle to be displayed in the pad is calculated from the
67       screen coordinates, since the rectangles must be the  same  size.  Both
68       rectangles  must  be  entirely contained within their respective struc‐
69       tures. Negative values of pminrow, pmincol,  sminrow,  or  smincol  are
70       treated as if they were zero.
71
72
73       The  pechochar()  routine  is  functionally  equivalent  to  a  call to
74       addch(3CURSES) followed by a call to refresh(3CURSES), a call  to  wad‐
75       dch(3CURSES) followed by a call to wrefresh(3CURSES), or a call to wad‐
76       dch(3CURSES) followed by a call to prefresh(). The knowledge that  only
77       a single character is being output is taken into consideration and, for
78       non-control characters, a considerable performance gain might  be  seen
79       by  using  these  routines instead of their equivalents. In the case of
80       pechochar(), the last location of the pad on the screen is  reused  for
81       the arguments to prefresh().
82

RETURN VALUES

84       Routines  that return an integer return ERR upon failure and an integer
85       value other than ERR upon successful completion.
86
87
88       Routines that return pointers return NULL on error.
89

ATTRIBUTES

91       See attributes(5) for descriptions of the following attributes:
92
93
94
95
96       ┌─────────────────────────────┬─────────────────────────────┐
97       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
98       ├─────────────────────────────┼─────────────────────────────┤
99       │MT-Level                     │Unsafe                       │
100       └─────────────────────────────┴─────────────────────────────┘
101

SEE ALSO

103       addch(3CURSES),  curses(3CURSES),  refresh(3CURSES),   subwin(3CURSES),
104       touchline(3CURSES),    touchwin(3CURSES),   waddch(3CURSES),   wnoutre‐
105       fresh(3CURSES), wrefresh(3CURSES), attributes(5)
106

NOTES

108       The header file <curses.h>  automatically  includes  the  header  files
109       <stdio.h>, <unctrl.h> and <widec.h>.
110
111
112       Note that pechochar() may be a macro.
113
114
115
116SunOS 5.11                        31 Dec 1996                curs_pad(3CURSES)
Impressum