]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_pad.3x.html
0da61e87c0d72946a6a3245e0336fb7fb4477c7a
[ncurses.git] / doc / html / man / curs_pad.3x.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <!-- 
3   ****************************************************************************
4   * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
5   *                                                                          *
6   * Permission is hereby granted, free of charge, to any person obtaining a  *
7   * copy of this software and associated documentation files (the            *
8   * "Software"), to deal in the Software without restriction, including      *
9   * without limitation the rights to use, copy, modify, merge, publish,      *
10   * distribute, distribute with modifications, sublicense, and/or sell       *
11   * copies of the Software, and to permit persons to whom the Software is    *
12   * furnished to do so, subject to the following conditions:                 *
13   *                                                                          *
14   * The above copyright notice and this permission notice shall be included  *
15   * in all copies or substantial portions of the Software.                   *
16   *                                                                          *
17   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24   *                                                                          *
25   * Except as contained in this notice, the name(s) of the above copyright   *
26   * holders shall not be used in advertising or otherwise to promote the     *
27   * sale, use or other dealings in this Software without prior written       *
28   * authorization.                                                           *
29   ****************************************************************************
30   * @Id: curs_pad.3x,v 1.9 2000/07/04 22:38:13 tom Exp @
31 -->
32 <HTML>
33 <HEAD>
34 <TITLE>curs_pad 3x</TITLE>
35 <link rev=made href="mailto:bug-ncurses@gnu.org">
36 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
37 </HEAD>
38 <BODY>
39 <H1>curs_pad 3x</H1>
40 <HR>
41 <PRE>
42 <!-- Manpage converted by man2html 3.0.1 -->
43
44 </PRE>
45 <H2>NAME</H2><PRE>
46        <STRONG>newpad</STRONG>, <STRONG>subpad</STRONG>, <STRONG>prefresh</STRONG>, <STRONG>pnoutrefresh</STRONG>, <STRONG>pechochar</STRONG> - create
47        and display <STRONG>curses</STRONG> pads
48
49
50 </PRE>
51 <H2>SYNOPSIS</H2><PRE>
52        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
53
54        <STRONG>WINDOW</STRONG> <STRONG>*newpad(int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols);</STRONG>
55        <STRONG>WINDOW</STRONG> <STRONG>*subpad(WINDOW</STRONG> <STRONG>*orig,</STRONG> <STRONG>int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols,</STRONG>
56              <STRONG>int</STRONG> <STRONG>begin_y,</STRONG> <STRONG>int</STRONG> <STRONG>begin_x);</STRONG>
57        <STRONG>int</STRONG> <STRONG>prefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
58              <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
59        <STRONG>int</STRONG> <STRONG>pnoutrefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
60              <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
61        <STRONG>int</STRONG> <STRONG>pechochar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
62
63
64 </PRE>
65 <H2>DESCRIPTION</H2><PRE>
66        The <STRONG>newpad</STRONG> routine creates and returns a pointer to a  new
67        pad data structure with the given number of lines, <EM>nlines</EM>,
68        and columns, <EM>ncols</EM>.  A pad is like a window,  except  that
69        it is not restricted by the screen size, and is not neces-
70        sarily associated with a particular part  of  the  screen.
71        Pads can be used when a large window is needed, and only a
72        part of the window will be on  the  screen  at  one  time.
73        Automatic refreshes of pads (<EM>e</EM>.<EM>g</EM>., from scrolling or echo-
74        ing of input) do not occur.  It is not legal to call  <STRONG>wre-</STRONG>
75        <STRONG>fresh</STRONG>  with a <EM>pad</EM> as an argument; the routines <STRONG>prefresh</STRONG> or
76        <STRONG>pnoutrefresh</STRONG> should be called instead.   Note  that  these
77        routines require additional parameters to specify the part
78        of the pad to be displayed and the location on the  screen
79        to be used for the display.
80
81        The <STRONG>subpad</STRONG> routine creates and returns a pointer to a sub-
82        window within a  pad  with  the  given  number  of  lines,
83        <EM>nlines</EM>,  and  columns,  <EM>ncols</EM>.   Unlike <STRONG>subwin</STRONG>, which uses
84        screen coordinates, the window is  at  position  (<EM>begin</EM>_<EM>x</EM><STRONG>,</STRONG>
85        <EM>begin</EM>_<EM>y</EM>)  on the pad.  The window is made in the middle of
86        the window <EM>orig</EM>, so that changes made to one window affect
87        both  windows.   During  the  use of this routine, it will
88        often be necessary to call <STRONG>touchwin</STRONG> or <STRONG>touchline</STRONG>  on  <EM>orig</EM>
89        before calling <STRONG>prefresh</STRONG>.
90
91        The  <STRONG>prefresh</STRONG>  and  <STRONG>pnoutrefresh</STRONG> routines are analogous to
92        <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> except that they relate to  pads
93        instead  of windows.  The additional parameters are needed
94        to indicate what part of the pad and screen are  involved.
95        <EM>pminrow</EM>  and <EM>pmincol</EM> specify the upper left-hand corner of
96        the rectangle to be displayed in the pad.  <EM>sminrow</EM>,  <EM>smin-</EM>
97        <EM>col</EM>, <EM>smaxrow</EM>, and <EM>smaxcol</EM> specify the edges of the rectan-
98        gle to be displayed on the screen.  The  lower  right-hand
99        corner of the rectangle to be displayed in the pad is cal-
100        culated from the screen coordinates, since the  rectangles
101        must  be  the same size.  Both rectangles must be entirely
102        contained within their  respective  structures.   Negative
103        values  of  <EM>pminrow</EM>,  <EM>pmincol</EM>,  <EM>sminrow</EM>,  or  <EM>smincol</EM>  are
104        treated as if they were zero.
105
106        The <STRONG>pechochar</STRONG> routine is functionally equivalent to a call
107        to  <STRONG>addch</STRONG>  followed by a call to <STRONG>refresh</STRONG>, a call to <STRONG>waddch</STRONG>
108        followed by a call to <STRONG>wrefresh</STRONG>, or a call to  <STRONG>waddch</STRONG>  fol-
109        lowed  by  a  call  to <STRONG>prefresh.</STRONG> The knowledge that only a
110        single character is being output is taken into  considera-
111        tion  and, for non-control characters, a considerable per-
112        formance gain  might  be  seen  by  using  these  routines
113        instead  of  their equivalents.  In the case of <STRONG>pechochar</STRONG>,
114        the last location of the pad on the screen is  reused  for
115        the arguments to <STRONG>prefresh</STRONG>.
116
117
118 </PRE>
119 <H2>RETURN VALUE</H2><PRE>
120        Routines  that  return  an integer return <STRONG>ERR</STRONG> upon failure
121        and <STRONG>OK</STRONG> (SVr4 only specifies "an integer value  other  than
122        <STRONG>ERR</STRONG>") upon successful completion.
123
124        Routines  that  return  pointers return <STRONG>NULL</STRONG> on error, and
125        set <STRONG>errno</STRONG> to <STRONG>ENOMEM</STRONG>.
126
127
128 </PRE>
129 <H2>NOTES</H2><PRE>
130        Note that <STRONG>pechochar</STRONG> may be a macro.
131
132
133 </PRE>
134 <H2>PORTABILITY</H2><PRE>
135        The XSI Curses standard, Issue  4  describes  these  func-
136        tions.
137
138
139 </PRE>
140 <H2>SEE ALSO</H2><PRE>
141        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,        <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,       <STRONG><A HREF="curs_touch.3x.html">curs_touch(3x)</A></STRONG>,
142        <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>.
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165 </PRE>
166 <HR>
167 <ADDRESS>
168 Man(1) output converted with
169 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
170 </ADDRESS>
171 </BODY>
172 </HTML>