1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
3 ****************************************************************************
4 * Copyright (c) 1998,2002 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 * Author: Thomas E. Dickey <dickey@clark.net> 1996,1997,2002
31 * @Id: resizeterm.3x,v 1.9 2002/02/16 22:32:24 tom Exp @
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">
40 <H1>resizeterm 3x</H1>
43 <!-- Manpage converted by man2html 3.0.1 -->
47 <STRONG>is_term_resized</STRONG>, <STRONG>resize_term</STRONG>, <STRONG>resizeterm</STRONG> - change the
52 <H2>SYNOPSIS</H2><PRE>
53 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
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>
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.
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.
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.
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.
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-
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.
111 <H2>SEE ALSO</H2><PRE>
112 <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
117 Thomas Dickey (from an equivalent function written in 1988
170 Man(1) output converted with
171 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>