]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/resizeterm.3x.html
ncurses 5.3
[ncurses.git] / doc / html / man / resizeterm.3x.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <!-- 
3   ****************************************************************************
4   * Copyright (c) 1998,2002 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   * Author: Thomas E. Dickey &lt;dickey@clark.net&gt; 1996,1997,2002
31   * @Id: resizeterm.3x,v 1.9 2002/02/16 22:32:24 tom Exp @
32 -->
33 <HTML>
34 <HEAD>
35 <TITLE>resizeterm 3x</TITLE>
36 <link rev=made href="mailto:bug-ncurses@gnu.org">
37 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
38 </HEAD>
39 <BODY>
40 <H1>resizeterm 3x</H1>
41 <HR>
42 <PRE>
43 <!-- Manpage converted by man2html 3.0.1 -->
44
45 </PRE>
46 <H2>NAME</H2><PRE>
47        <STRONG>is_term_resized</STRONG>,  <STRONG>resize_term</STRONG>,  <STRONG>resizeterm</STRONG>  -  change  the
48        curses terminal size
49
50
51 </PRE>
52 <H2>SYNOPSIS</H2><PRE>
53        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
54
55        <STRONG>bool</STRONG> <STRONG>is_term_resized(int</STRONG> <STRONG>lines,</STRONG> <STRONG>int</STRONG> <STRONG>columns);</STRONG>
56        <STRONG>int</STRONG> <STRONG>resize_term(int</STRONG> <STRONG>lines,</STRONG> <STRONG>int</STRONG> <STRONG>columns);</STRONG>
57        <STRONG>int</STRONG> <STRONG>resizeterm(int</STRONG> <STRONG>lines,</STRONG> <STRONG>int</STRONG> <STRONG>columns);</STRONG>
58
59
60 </PRE>
61 <H2>DESCRIPTION</H2><PRE>
62        This is an extension to the curses library.   It  provides
63        callers  with  a hook into the <STRONG>ncurses</STRONG> data to resize win-
64        dows, primarily for use by programs running in an X Window
65        terminal  (e.g.,  xterm).  The function <STRONG>resizeterm</STRONG> resizes
66        the standard and current windows to the  specified  dimen-
67        sions,  and  adjusts  other  bookkeeping  data used by the
68        <STRONG>ncurses</STRONG> library that record the window dimensions.
69
70        Most  of  the  work  is  done  by   the   inner   function
71        <STRONG>resize_term</STRONG>.  The outer function <STRONG>resizeterm</STRONG> adds bookkeep-
72        ing for the SIGWINCH handler.  When resizing the  windows,
73        <STRONG>resize_term</STRONG>  blank-fills the areas that are extended.  The
74        calling application should fill in these areas with appro-
75        priate  data.  The <STRONG>resize_term</STRONG> function attempts to resize
76        all windows.  However, due to the  calling  convention  of
77        pads,  it  is  not  possible to resize these without addi-
78        tional interaction with the application.
79
80        A support function <STRONG>is_term_resized</STRONG>  is  provided  so  that
81        applications  can  check if the <STRONG>resize_term</STRONG> function would
82        modify the window structures.  It returns TRUE if the win-
83        dows would be modified, and FALSE otherwise.
84
85
86 </PRE>
87 <H2>RETURN VALUE</H2><PRE>
88        Except  as  notes,  these  function return the integer <STRONG>ERR</STRONG>
89        upon failure and <STRONG>OK</STRONG> on success.  They will fail if  either
90        of the dimensions are less than or equal to zero, or if an
91        error occurs while (re)allocating memory for the  windows.
92
93
94 </PRE>
95 <H2>NOTES</H2><PRE>
96        While these functions are intended to be used to support a
97        signal handler (i.e., for SIGWINCH), care should be  taken
98        to  avoid invoking them in a context where <STRONG>malloc</STRONG> or <STRONG>real-</STRONG>
99        <STRONG>loc</STRONG> may have been interrupted, since it uses  those  func-
100        tions.
101
102        If  ncurses  is configured to supply its own SIGWINCH han-
103        dler, the <STRONG>resizeterm</STRONG> function ungetch's a <STRONG>KEY_RESIZE</STRONG> which
104        will  be  read on the next call to <STRONG>getch</STRONG>.  This is used to
105        alert an application that the screen size has changed, and
106        that  it should repaint special features such as pads that
107        cannot be done automatically.
108
109
110 </PRE>
111 <H2>SEE ALSO</H2><PRE>
112        <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
113
114
115 </PRE>
116 <H2>AUTHOR</H2><PRE>
117        Thomas Dickey (from an equivalent function written in 1988
118        for BSD curses).
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167 </PRE>
168 <HR>
169 <ADDRESS>
170 Man(1) output converted with
171 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
172 </ADDRESS>
173 </BODY>
174 </HTML>