resizeterm.3x.html 6.8 KB

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