1newpad(3XCURSES)        X/Open Curses Library Functions       newpad(3XCURSES)
2
3
4

NAME

6       newpad,  pnoutrefresh,  prefresh,  subpad  - create or refresh a pad or
7       subpad
8

SYNOPSIS

10       cc [ flag... ] file... -I /usr/xpg4/include  -L  /usr/xpg4/lib \
11        -R  /usr/xpg4/lib  -lcurses  [ library... ]
12
13       c89 [ flag... ] file... -lcurses [ library... ]
14
15       #include <curses.h>
16
17       WINDOW *newpad(int nlines, int ncols);
18
19
20       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow,
21            int smincol,int smaxrow, int smaxcol);
22
23
24       int prefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow,
25            int smincol,int smaxrow, int smaxcol);
26
27
28       WINDOW *subpad(WINDOW *orig, int nlines, int ncols);
29
30

PARAMETERS

32       nlines     Is the number of lines in the pad to be created.
33
34
35       ncols      Is the number of columns in the pad to be created.
36
37
38       pad        Is a pointer to the pad to refresh.
39
40
41       pminrow    Is the row coordinate of the upper left corner  of  the  pad
42                  rectangle to be  copied
43
44
45       pmincol    Is the column coordinate of the upper left corner of the pad
46                  rectangle to be  copied.
47
48
49       sminrow    Is the row coordinate of the upper left corner of  the  rec‐
50                  tangle on the physical screen where pad is to be positioned.
51
52
53       smincol    Is  the  column  coordinate  of the upper left corner of the
54                  rectangle on the  physical screen where pad is to  be  posi‐
55                  tioned.
56
57
58       smaxrow    Is  the row coordinate of the lower right corner of the rec‐
59                  tangle on the  physical screen where the pad is to be  posi‐
60                  tioned.
61
62
63       smaxcol    Is  the  column  coordinate of the lower right corner of the
64                  rectangle on the  physical screen where the  pad  is  to  be
65                  positioned.
66
67
68       orig       Is  a  pointer  to  the parent pad within which a sub-pad is
69                  created.
70
71

DESCRIPTION

73       The newpad() function creates a new pad with the  specified  number  of
74       lines  and columns.  A pointer to the new pad structure is returned.  A
75       pad differs from a window in that it is not restricted to the  size  of
76       the   physical  screen.   It is useful when only part of a large window
77       will be displayed at any one  time.
78
79
80       Automatic refreshes by scrolling or echoing of input do not take  place
81       when   pads are used.  Pads have their own refresh commands, prefresh()
82       and pnoutrefresh().
83
84
85       The prefresh() function copies the specified portion of the logical pad
86       to the terminal screen.  The parameters pmincol and pminrow specify the
87       upper left corner of the rectangular area of the pad to  be  displayed.
88       The  lower  right coordinate of the rectangular area of the pad that is
89       to be  displayed is calculated from  the  screen  parameters  (sminrow,
90       smincol, smaxrow, smaxcol).
91
92
93       This  function  calls the pnoutrefresh() function to copy the specified
94       portion of pad to the terminal screen and the doupdate(3XCURSES)  func‐
95       tion to do the actual update.  The logical cursor is copied to the same
96       location in the physical window unless leaveok(3XCURSES) is enabled (in
97       which  case,  the cursor is placed in a position that the program finds
98       convenient).
99
100
101       When outputting several pads at once, it is  often  more  efficient  to
102       call  the  pnoutrefresh()  and doupdate() functions directly. A call to
103       pnoutrefresh() for each pad first, followed by only one call  to  doup‐
104       date()  to  update  the  screen, results in one burst of output,  fewer
105       characters sent, and less CPU time used.
106
107
108       The subpad() function creates a sub-pad within the pad orig  with   the
109       specified number of lines and columns.  A pointer to the new pad struc‐
110       ture is returned. The sub-pad is positioned in the middle of orig.  Any
111       changes  made  to  one  pad  affect  the other.   touchwin(3XCURSES) or
112       touchline(3XCURSES) will likely have to be called on pad  orig to  cor‐
113       rectly update the window.
114

RETURN VALUES

116       On  success,  the  newpad() and subpad() functions returns a pointer to
117       the new pad data structure. Otherwise, they return a null pointer.
118
119
120       On success, the pnoutrefresh() and  prefresh()  functions  return   OK.
121       Otherwise, they return ERR.
122

ATTRIBUTES

124       See attributes(5) for descriptions of the following attributes:
125
126
127
128
129       ┌─────────────────────────────┬─────────────────────────────┐
130       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
131       ├─────────────────────────────┼─────────────────────────────┤
132       │Interface Stability          │Standard                     │
133       ├─────────────────────────────┼─────────────────────────────┤
134       │MT-Level                     │Unsafe                       │
135       └─────────────────────────────┴─────────────────────────────┘
136

SEE ALSO

138       clearok(3XCURSES),     doupdate(3XCURSES),    is_linetouched(3XCURSES),
139       libcurses(3XCURSES), pechochar(3XCURSES), attributes(5), standards(5)
140
141
142
143SunOS 5.11                        5 Jun 2002                  newpad(3XCURSES)
Impressum