]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/resizeterm.3x.html
5f2defe2ab726506747821221f2e705bcfcf549e
[ncurses.git] / doc / html / man / resizeterm.3x.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <!-- 
3   ****************************************************************************
4   * Copyright (c) 1998-2012,2013 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 1996-on
31   * @Id: resizeterm.3x,v 1.17 2013/06/22 20:41:54 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 <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>                                           <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>
45
46
47
48
49 </PRE>
50 <H2>NAME</H2><PRE>
51        <STRONG>is_term_resized</STRONG>,  <STRONG>resize_term</STRONG>,  <STRONG>resizeterm</STRONG>  -  change  the
52        curses terminal size
53
54
55 </PRE>
56 <H2>SYNOPSIS</H2><PRE>
57        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
58
59        <STRONG>bool</STRONG> <STRONG>is_term_resized(int</STRONG> <STRONG>lines,</STRONG> <STRONG>int</STRONG> <STRONG>columns);</STRONG>
60        <STRONG>int</STRONG> <STRONG>resize_term(int</STRONG> <STRONG>lines,</STRONG> <STRONG>int</STRONG> <STRONG>columns);</STRONG>
61        <STRONG>int</STRONG> <STRONG>resizeterm(int</STRONG> <STRONG>lines,</STRONG> <STRONG>int</STRONG> <STRONG>columns);</STRONG>
62
63
64 </PRE>
65 <H2>DESCRIPTION</H2><PRE>
66        This is an extension to the curses library.   It  provides
67        callers  with  a hook into the <STRONG>ncurses</STRONG> data to resize win-
68        dows, primarily for use by programs running in an X Window
69        terminal  (e.g.,  xterm).  The function <STRONG>resizeterm</STRONG> resizes
70        the standard and current windows to the  specified  dimen-
71        sions,  and  adjusts  other  bookkeeping  data used by the
72        <STRONG>ncurses</STRONG> library that record the window dimensions such  as
73        the <STRONG>LINES</STRONG> and <STRONG>COLS</STRONG> variables.
74
75        Most   of   the   work  is  done  by  the  inner  function
76        <STRONG>resize_term</STRONG>.  The outer function <STRONG>resizeterm</STRONG> adds bookkeep-
77        ing  for the SIGWINCH handler.  When resizing the windows,
78        <STRONG>resize_term</STRONG> blank-fills the areas that are extended.   The
79        calling application should fill in these areas with appro-
80        priate data.  The <STRONG>resize_term</STRONG> function attempts to  resize
81        all  windows.   However,  due to the calling convention of
82        pads, it is not possible to  resize  these  without  addi-
83        tional interaction with the application.
84
85        A  support  function  <STRONG>is_term_resized</STRONG>  is provided so that
86        applications can check if the <STRONG>resize_term</STRONG>  function  would
87        modify the window structures.  It returns TRUE if the win-
88        dows would be modified, and FALSE otherwise.
89
90
91 </PRE>
92 <H2>RETURN VALUE</H2><PRE>
93        Except as noted, these functions return  the  integer  <STRONG>ERR</STRONG>
94        upon  failure and <STRONG>OK</STRONG> on success.  They will fail if either
95        of the dimensions are less than or equal to zero, or if an
96        error occurs while (re)allocating memory for the windows.
97
98
99 </PRE>
100 <H2>NOTES</H2><PRE>
101        While these functions are intended to be used to support a
102        signal handler (i.e., for SIGWINCH), care should be  taken
103        to  avoid invoking them in a context where <STRONG>malloc</STRONG> or <STRONG>real-</STRONG>
104        <STRONG>loc</STRONG> may have been interrupted, since it uses  those  func-
105        tions.
106
107        If  ncurses  is configured to supply its own SIGWINCH han-
108        dler, the <STRONG>resizeterm</STRONG> function <STRONG>ungetch</STRONG>'s a <STRONG>KEY_RESIZE</STRONG> which
109        will  be  read on the next call to <STRONG>getch</STRONG>.  This is used to
110        alert an application that the screen size has changed, and
111        that  it should repaint special features such as pads that
112        cannot be done automatically.
113
114        If the environment variables <STRONG>LINES</STRONG>  or  <STRONG>COLUMNS</STRONG>  are  set,
115        this  overrides  the  library's  use  of  the  window size
116        obtained from the operating system.  Thus, even if a  SIG-
117        WINCH is received, no screen size change may be recorded.
118
119
120 </PRE>
121 <H2>SEE ALSO</H2><PRE>
122        <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
123
124
125 </PRE>
126 <H2>AUTHOR</H2><PRE>
127        Thomas Dickey (from an equivalent function written in 1988
128        for BSD curses).
129
130
131
132                                                          <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>
133 </PRE>
134 <HR>
135 <ADDRESS>
136 Man(1) output converted with
137 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
138 </ADDRESS>
139 </BODY>
140 </HTML>