]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_pad.3x.html
ncurses 6.0 - patch 20170506
[ncurses.git] / doc / html / man / curs_pad.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 1998-2015,2017 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.19 2017/01/07 19:25:15 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 class="no-header">curs_pad 3x</H1>
42 <PRE>
43 <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>                                                      <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>
44
45
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49        <STRONG>newpad</STRONG>, <STRONG>subpad</STRONG>, <STRONG>prefresh</STRONG>, <STRONG>pnoutrefresh</STRONG>, <STRONG>pechochar</STRONG>, <STRONG>pecho_wchar</STRONG> - create
50        and display <STRONG>curses</STRONG> pads
51
52
53 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
54        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
55
56        <STRONG>WINDOW</STRONG> <STRONG>*newpad(int</STRONG> <EM>nlines</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>ncols</EM><STRONG>);</STRONG>
57        <STRONG>WINDOW</STRONG> <STRONG>*subpad(WINDOW</STRONG> <STRONG>*</STRONG><EM>orig</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>nlines</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>ncols</EM><STRONG>,</STRONG>
58              <STRONG>int</STRONG> <EM>begin</EM><STRONG>_</STRONG><EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>begin</EM><STRONG>_</STRONG><EM>x</EM><STRONG>);</STRONG>
59        <STRONG>int</STRONG> <STRONG>prefresh(WINDOW</STRONG> <STRONG>*</STRONG><EM>pad</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>pminrow</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>pmincol</EM><STRONG>,</STRONG>
60              <STRONG>int</STRONG> <EM>sminrow</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>smincol</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>smaxrow</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>smaxcol</EM><STRONG>);</STRONG>
61        <STRONG>int</STRONG> <STRONG>pnoutrefresh(WINDOW</STRONG> <STRONG>*</STRONG><EM>pad</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>pminrow</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>pmincol</EM><STRONG>,</STRONG>
62              <STRONG>int</STRONG> <EM>sminrow</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>smincol</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>smaxrow</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>smaxcol</EM><STRONG>);</STRONG>
63        <STRONG>int</STRONG> <STRONG>pechochar(WINDOW</STRONG> <STRONG>*</STRONG><EM>pad</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
64        <STRONG>int</STRONG> <STRONG>pecho_wchar(WINDOW</STRONG> <STRONG>*</STRONG><EM>pad</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
65
66
67 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
68
69 </PRE><H3><a name="h3-newpad">newpad</a></H3><PRE>
70        The <STRONG>newpad</STRONG> routine creates and returns a pointer  to  a  new  pad  data
71        structure  with  the given number of lines, <EM>nlines</EM>, and columns, <EM>ncols</EM>.
72        A pad is like a window, except that it is not restricted by the  screen
73        size,  and  is not necessarily associated with a particular part of the
74        screen.  Pads can be used when a large window is  needed,  and  only  a
75        part  of  the  window will be on the screen at one time.  Automatic re-
76        freshes of pads (e.g., from scrolling or echoing of input) do  not  oc-
77        cur.   It  is not legal to call <STRONG>wrefresh</STRONG> with a <EM>pad</EM> as an argument; the
78        routines <STRONG>prefresh</STRONG> or <STRONG>pnoutrefresh</STRONG> should be called instead.  Note  that
79        these routines require additional parameters to specify the part of the
80        pad to be displayed and the location on the screen to be used  for  the
81        display.
82
83
84 </PRE><H3><a name="h3-subpad">subpad</a></H3><PRE>
85        The  <STRONG>subpad</STRONG> routine creates and returns a pointer to a subwindow within
86        a pad with the given number of lines, <EM>nlines</EM>, and columns, <EM>ncols</EM>.   Un-
87        like  <STRONG>subwin</STRONG>,  which uses screen coordinates, the window is at position
88        (<EM>begin</EM>_<EM>x</EM><STRONG>,</STRONG> <EM>begin</EM>_<EM>y</EM>) on the pad.  The window is made in the middle of the
89        window  <EM>orig</EM>,  so  that changes made to one window affect both windows.
90        During the use of this routine, it will  often  be  necessary  to  call
91        <STRONG>touchwin</STRONG> or <STRONG>touchline</STRONG> on <EM>orig</EM> before calling <STRONG>prefresh</STRONG>.
92
93
94 </PRE><H3><a name="h3-prefresh_-pnoutrefresh">prefresh, pnoutrefresh</a></H3><PRE>
95        The  <STRONG>prefresh</STRONG>  and  <STRONG>pnoutrefresh</STRONG> routines are analogous to <STRONG>wrefresh</STRONG> and
96        <STRONG>wnoutrefresh</STRONG> except that they relate to pads instead of  windows.   The
97        additional  parameters  are needed to indicate what part of the pad and
98        screen are involved.  The <EM>pminrow</EM> and <EM>pmincol</EM>  parameters  specify  the
99        upper  left-hand  corner  of  the rectangle to be displayed in the pad.
100        The <EM>sminrow</EM>, <EM>smincol</EM>, <EM>smaxrow</EM>, and <EM>smaxcol</EM> parameters specify the edges
101        of  the  rectangle to be displayed on the screen.  The lower right-hand
102        corner of the rectangle to be displayed in the pad is  calculated  from
103        the  screen  coordinates,  since  the rectangles must be the same size.
104        Both rectangles must be  entirely  contained  within  their  respective
105        structures.   Negative  values of <EM>pminrow</EM>, <EM>pmincol</EM>, <EM>sminrow</EM>, or <EM>smincol</EM>
106        are treated as if they were zero.
107
108
109 </PRE><H3><a name="h3-pechochar">pechochar</a></H3><PRE>
110        The <STRONG>pechochar</STRONG> routine is functionally equivalent to  a  call  to  <STRONG>addch</STRONG>
111        followed  by a call to <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG>, a call to <STRONG>waddch</STRONG> followed by a call
112        to <STRONG>wrefresh</STRONG>, or a call to <STRONG>waddch</STRONG> followed by a call to  <STRONG>prefresh</STRONG>.   The
113        knowledge  that  only  a single character is being output is taken into
114        consideration and, for non-control characters, a  considerable  perfor-
115        mance  gain  might  be  seen  by  using these routines instead of their
116        equivalents.  In the case of <STRONG>pechochar</STRONG>, the last location of the pad on
117        the screen is reused for the arguments to <STRONG>prefresh</STRONG>.
118
119
120 </PRE><H3><a name="h3-pecho_wchar">pecho_wchar</a></H3><PRE>
121        The  <STRONG>pecho_wchar</STRONG>  function  is the analogous wide-character form of <STRONG>pe-</STRONG>
122        <STRONG>chochar</STRONG>.  It outputs one character to a pad and  immediately  refreshes
123        the pad.  It does this by a call to <STRONG>wadd_wch</STRONG> followed by a call to <STRONG>pre-</STRONG>
124        <STRONG>fresh</STRONG>.
125
126
127 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
128        Routines that return an integer return <STRONG>ERR</STRONG> upon failure  and  <STRONG>OK</STRONG>  (SVr4
129        only  specifies "an integer value other than <STRONG>ERR</STRONG>") upon successful com-
130        pletion.
131
132        Routines that return pointers return <STRONG>NULL</STRONG> on error, and  set  <STRONG>errno</STRONG>  to
133        <STRONG>ENOMEM</STRONG>.
134
135        X/Open does not define any error conditions.  In this implementation
136
137           <STRONG>prefresh</STRONG> and <STRONG>pnoutrefresh</STRONG>
138                return an error if the window pointer is null, or if the window
139                is not really a pad or if the  area  to  refresh  extends  off-
140                screen or if the minimum coordinates are greater than the maxi-
141                mum.
142
143           <STRONG>pechochar</STRONG>
144                returns an error if the window is not really a pad, and the as-
145                sociated call to <STRONG>wechochar</STRONG> returns an error.
146
147           <STRONG>pecho_wchar</STRONG>
148                returns an error if the window is not really a pad, and the as-
149                sociated call to <STRONG>wecho_wchar</STRONG> returns an error.
150
151
152 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
153        Note that <STRONG>pechochar</STRONG> may be a macro.
154
155
156 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
157        The XSI Curses standard, Issue 4 describes these functions.
158
159
160 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
161        <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><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>.
162
163
164
165                                                                   <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>
166 </PRE>
167 <div class="nav">
168 <ul>
169 <li><a href="#h2-NAME">NAME</a></li>
170 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
171 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
172 <ul>
173 <li><a href="#h3-newpad">newpad</a></li>
174 <li><a href="#h3-subpad">subpad</a></li>
175 <li><a href="#h3-prefresh_-pnoutrefresh">prefresh, pnoutrefresh</a></li>
176 <li><a href="#h3-pechochar">pechochar</a></li>
177 <li><a href="#h3-pecho_wchar">pecho_wchar</a></li>
178 </ul>
179 </li>
180 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
181 <li><a href="#h2-NOTES">NOTES</a></li>
182 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
183 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
184 </ul>
185 </div>
186 </BODY>
187 </HTML>