1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
3 ****************************************************************************
4 * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
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: *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
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. *
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 *
29 ****************************************************************************
30 * @Id: curs_pad.3x,v 1.12 2004/01/04 01:36:49 tom Exp @
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">
42 <!-- Manpage converted by man2html 3.0.1 -->
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>
50 <STRONG>newpad</STRONG>, <STRONG>subpad</STRONG>, <STRONG>prefresh</STRONG>, <STRONG>pnoutrefresh</STRONG>, <STRONG>pechochar</STRONG>,
51 <STRONG>pecho_wchar</STRONG> - create and display <STRONG>curses</STRONG> pads
55 <H2>SYNOPSIS</H2><PRE>
56 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
58 <STRONG>WINDOW</STRONG> <STRONG>*newpad(int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols);</STRONG>
59 <STRONG>WINDOW</STRONG> <STRONG>*subpad(WINDOW</STRONG> <STRONG>*orig,</STRONG> <STRONG>int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols,</STRONG>
60 <STRONG>int</STRONG> <STRONG>begin_y,</STRONG> <STRONG>int</STRONG> <STRONG>begin_x);</STRONG>
61 <STRONG>int</STRONG> <STRONG>prefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
62 <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
63 <STRONG>int</STRONG> <STRONG>pnoutrefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
64 <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
65 <STRONG>int</STRONG> <STRONG>pechochar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
66 <STRONG>int</STRONG> <STRONG>pecho_wchar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*wch);</STRONG>
70 <H2>DESCRIPTION</H2><PRE>
71 The <STRONG>newpad</STRONG> routine creates and returns a pointer to a new
72 pad data structure with the given number of lines, <EM>nlines</EM>,
73 and columns, <EM>ncols</EM>. A pad is like a window, except that
74 it is not restricted by the screen size, and is not neces-
75 sarily associated with a particular part of the screen.
76 Pads can be used when a large window is needed, and only a
77 part of the window will be on the screen at one time.
78 Automatic refreshes of pads (e.g., from scrolling or echo-
79 ing of input) do not occur. It is not legal to call <STRONG>wre-</STRONG>
80 <STRONG>fresh</STRONG> with a <EM>pad</EM> as an argument; the routines <STRONG>prefresh</STRONG> or
81 <STRONG>pnoutrefresh</STRONG> should be called instead. Note that these
82 routines require additional parameters to specify the part
83 of the pad to be displayed and the location on the screen
84 to be used for the display.
86 The <STRONG>subpad</STRONG> routine creates and returns a pointer to a sub-
87 window within a pad with the given number of lines,
88 <EM>nlines</EM>, and columns, <EM>ncols</EM>. Unlike <STRONG>subwin</STRONG>, which uses
89 screen coordinates, the window is at position (<EM>begin</EM>_<EM>x</EM><STRONG>,</STRONG>
90 <EM>begin</EM>_<EM>y</EM>) on the pad. The window is made in the middle of
91 the window <EM>orig</EM>, so that changes made to one window affect
92 both windows. During the use of this routine, it will
93 often be necessary to call <STRONG>touchwin</STRONG> or <STRONG>touchline</STRONG> on <EM>orig</EM>
94 before calling <STRONG>prefresh</STRONG>.
96 The <STRONG>prefresh</STRONG> and <STRONG>pnoutrefresh</STRONG> routines are analogous to
97 <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> except that they relate to pads
98 instead of windows. The additional parameters are needed
99 to indicate what part of the pad and screen are involved.
100 <EM>pminrow</EM> and <EM>pmincol</EM> specify the upper left-hand corner of
101 the rectangle to be displayed in the pad. <EM>sminrow</EM>, <EM>smin-</EM>
102 <EM>col</EM>, <EM>smaxrow</EM>, and <EM>smaxcol</EM> specify the edges of the rectan-
103 gle to be displayed on the screen. The lower right-hand
104 corner of the rectangle to be displayed in the pad is cal-
105 culated from the screen coordinates, since the rectangles
106 must be the same size. Both rectangles must be entirely
107 contained within their respective structures. Negative
108 values of <EM>pminrow</EM>, <EM>pmincol</EM>, <EM>sminrow</EM>, or <EM>smincol</EM> are
109 treated as if they were zero.
111 The <STRONG>pechochar</STRONG> routine is functionally equivalent to a call
112 to <STRONG>addch</STRONG> followed by a call to <STRONG>refresh</STRONG>, a call to <STRONG>waddch</STRONG>
113 followed by a call to <STRONG>wrefresh</STRONG>, or a call to <STRONG>waddch</STRONG> fol-
114 lowed by a call to <STRONG>prefresh</STRONG>. The knowledge that only a
115 single character is being output is taken into considera-
116 tion and, for non-control characters, a considerable per-
117 formance gain might be seen by using these routines
118 instead of their equivalents. In the case of <STRONG>pechochar</STRONG>,
119 the last location of the pad on the screen is reused for
120 the arguments to <STRONG>prefresh</STRONG>.
122 The <STRONG>pecho_wchar</STRONG> function is the analogous wide-character
123 form of <STRONG>pechochar</STRONG>. It outputs one character to a pad and
124 immediately refreshes the pad. It does this by a call to
125 <STRONG>wadd_wch</STRONG> followed by a call to <STRONG>prefresh</STRONG>.
129 <H2>RETURN VALUE</H2><PRE>
130 Routines that return an integer return <STRONG>ERR</STRONG> upon failure
131 and <STRONG>OK</STRONG> (SVr4 only specifies "an integer value other than
132 <STRONG>ERR</STRONG>") upon successful completion.
134 Routines that return pointers return <STRONG>NULL</STRONG> on error, and
135 set <STRONG>errno</STRONG> to <STRONG>ENOMEM</STRONG>.
140 Note that <STRONG>pechochar</STRONG> may be a macro.
144 <H2>PORTABILITY</H2><PRE>
145 The XSI Curses standard, Issue 4 describes these func-
150 <H2>SEE ALSO</H2><PRE>
151 <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>,
152 <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>.
156 <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG>
160 Man(1) output converted with
161 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>