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