1curs_pad(3X)                                                      curs_pad(3X)
2
3
4

NAME

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

SYNOPSIS

10       #include <curses.h>
11
12       WINDOW *newpad(int nlines, int ncols);
13       WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
14             int begin_y, int begin_x);
15       int prefresh(WINDOW *pad, int pminrow, int pmincol,
16             int sminrow, int smincol, int smaxrow, int smaxcol);
17       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
18             int sminrow, int smincol, int smaxrow, int smaxcol);
19       int pechochar(WINDOW *pad, chtype ch);
20       int pecho_wchar(WINDOW *pad, const cchar_t *wch);
21

DESCRIPTION

23       The newpad routine creates and returns a pointer  to  a  new  pad  data
24       structure  with  the given number of lines, nlines, and columns, ncols.
25       A pad is like a window, except that it is not restricted by the  screen
26       size,  and  is not necessarily associated with a particular part of the
27       screen.  Pads can be used when a large window is  needed,  and  only  a
28       part  of  the  window will be on the screen at one time.  Automatic re‐
29       freshes of pads (e.g., from scrolling or echoing of input) do  not  oc‐
30       cur.   It  is not legal to call wrefresh with a pad as an argument; the
31       routines prefresh or pnoutrefresh should be called instead.  Note  that
32       these routines require additional parameters to specify the part of the
33       pad to be displayed and the location on the screen to be used  for  the
34       display.
35
36       The  subpad routine creates and returns a pointer to a subwindow within
37       a pad with the given number of lines, nlines, and columns, ncols.   Un‐
38       like  subwin,  which uses screen coordinates, the window is at position
39       (begin_x, begin_y) on the pad.  The window is made in the middle of the
40       window  orig,  so  that changes made to one window affect both windows.
41       During the use of this routine, it will  often  be  necessary  to  call
42       touchwin or touchline on orig before calling prefresh.
43
44       The  prefresh  and  pnoutrefresh routines are analogous to wrefresh and
45       wnoutrefresh except that they relate to pads instead of  windows.   The
46       additional  parameters  are needed to indicate what part of the pad and
47       screen are involved.  The pminrow and pmincol  parameters  specify  the
48       upper  left-hand  corner  of  the rectangle to be displayed in the pad.
49       The sminrow, smincol, smaxrow, and smaxcol parameters specify the edges
50       of  the  rectangle to be displayed on the screen.  The lower right-hand
51       corner of the rectangle to be displayed in the pad is  calculated  from
52       the  screen  coordinates,  since  the rectangles must be the same size.
53       Both rectangles must be  entirely  contained  within  their  respective
54       structures.   Negative  values of pminrow, pmincol, sminrow, or smincol
55       are treated as if they were zero.
56
57       The pechochar routine is functionally equivalent to  a  call  to  addch
58       followed  by  a call to refresh, a call to waddch followed by a call to
59       wrefresh, or a call to waddch followed by  a  call  to  prefresh.   The
60       knowledge  that  only  a single character is being output is taken into
61       consideration and, for non-control characters, a  considerable  perfor‐
62       mance  gain  might  be  seen  by  using these routines instead of their
63       equivalents.  In the case of pechochar, the last location of the pad on
64       the screen is reused for the arguments to prefresh.
65
66       The  pecho_wchar  function  is the analogous wide-character form of pe‐
67       chochar.  It outputs one character to a pad and  immediately  refreshes
68       the pad.  It does this by a call to wadd_wch followed by a call to pre‐
69       fresh.
70

RETURN VALUE

72       Routines that return an integer return ERR upon failure  and  OK  (SVr4
73       only  specifies "an integer value other than ERR") upon successful com‐
74       pletion.
75
76       Routines that return pointers return NULL on error, and  set  errno  to
77       ENOMEM.
78
79       X/Open does not define any error conditions.  In this implementation
80
81              prefresh and pnoutrefresh
82                   return  an  error  if the window pointer is null, or if the
83                   window is not really a pad or if the area  to  refresh  ex‐
84                   tends  off-screen or if the minimum coordinates are greater
85                   than the maximum.
86
87              pechochar
88                   returns an error if the window is not really a pad, and the
89                   associated call to wechochar returns an error.
90
91              pecho_wchar
92                   returns an error if the window is not really a pad, and the
93                   associated call to wecho_wchar returns an error.
94

NOTES

96       Note that pechochar may be a macro.
97

PORTABILITY

99       The XSI Curses standard, Issue 4 describes these functions.
100

SEE ALSO

102       curses(3X), curs_refresh(3X), curs_touch(3X), curs_addch(3X).
103
104
105
106                                                                  curs_pad(3X)
Impressum