| 1 |
.\"*************************************************************************** |
| 2 |
.\" Copyright 2018-2024,2025 Thomas E. Dickey * |
| 3 |
.\" Copyright 1998-2010,2015 Free Software Foundation, Inc. * |
| 4 |
.\" * |
| 5 |
.\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 |
.\" copy of this software and associated documentation files (the * |
| 7 |
.\" "Software"), to deal in the Software without restriction, including * |
| 8 |
.\" without limitation the rights to use, copy, modify, merge, publish, * |
| 9 |
.\" distribute, distribute with modifications, sublicense, and/or sell * |
| 10 |
.\" copies of the Software, and to permit persons to whom the Software is * |
| 11 |
.\" furnished to do so, subject to the following conditions: * |
| 12 |
.\" * |
| 13 |
.\" The above copyright notice and this permission notice shall be included * |
| 14 |
.\" in all copies or substantial portions of the Software. * |
| 15 |
.\" * |
| 16 |
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 |
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 |
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 |
.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 |
.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 |
.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 |
.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 |
.\" * |
| 24 |
.\" Except as contained in this notice, the name(s) of the above copyright * |
| 25 |
.\" holders shall not be used in advertising or otherwise to promote the * |
| 26 |
.\" sale, use or other dealings in this Software without prior written * |
| 27 |
.\" authorization. * |
| 28 |
.\"*************************************************************************** |
| 29 |
.\" |
| 30 |
.\" Author: Thomas E. Dickey 1996 |
| 31 |
.\" |
| 32 |
.\" $Id: wresize.3x,v 1.47 2025/01/19 00:51:54 tom Exp $ |
| 33 |
.TH wresize 3NCURSES 2025-01-18 "ncurses 6.6" "Library calls" |
| 34 |
.SH NAME |
| 35 |
\fB\%wresize\fP \- |
| 36 |
resize a \fIcurses\fR window |
| 37 |
.SH SYNOPSIS |
| 38 |
.nf |
| 39 |
\fB#include <curses.h> |
| 40 |
.PP |
| 41 |
\fBint wresize(WINDOW * \fIwin\fP, int \fIlines\fP, int \fIcolumns\fP); |
| 42 |
.fi |
| 43 |
.SH DESCRIPTION |
| 44 |
.BR \%wresize "," |
| 45 |
an |
| 46 |
.I \%ncurses |
| 47 |
extension to the |
| 48 |
.I curses |
| 49 |
library, |
| 50 |
reallocates storage for |
| 51 |
.IR win , |
| 52 |
adjusting its dimensions to |
| 53 |
.I lines |
| 54 |
and |
| 55 |
.IR columns "." |
| 56 |
If either dimension is larger than its current value, |
| 57 |
.I \%ncurses |
| 58 |
fills the expanded part of the window |
| 59 |
with the window's background character as configured by |
| 60 |
\fB\%wbkgdset\fP(3NCURSES) |
| 61 |
(wide-character API: \fB\%wbkgrndset\fP(3NCURSES)). |
| 62 |
.SH RETURN VALUE |
| 63 |
.B \%wresize |
| 64 |
returns |
| 65 |
.B OK |
| 66 |
on success and |
| 67 |
.B ERR |
| 68 |
on failure. |
| 69 |
It fails if either |
| 70 |
.I lines |
| 71 |
or |
| 72 |
.I columns |
| 73 |
is less than or equal to zero, |
| 74 |
or if an error occurs while (re)allocating memory for |
| 75 |
.IR win "." |
| 76 |
.SH NOTES |
| 77 |
The only restriction placed on the values of |
| 78 |
.I lines |
| 79 |
and |
| 80 |
.I columns |
| 81 |
is that they be greater than zero. |
| 82 |
They are |
| 83 |
.I not |
| 84 |
compared to the dimensions of the |
| 85 |
.I curses |
| 86 |
screen; |
| 87 |
this keeps the logic of \fB\%resizeterm\fP(3NCURSES) simple. |
| 88 |
The caller must ensure that |
| 89 |
.IR win 's |
| 90 |
dimensions fit within those of the screen. |
| 91 |
.SH EXTENSIONS |
| 92 |
.B \%wresize |
| 93 |
is an \fB\%ncurses\fP(3NCURSES) extension, |
| 94 |
and is not found in SVr4 |
| 95 |
.IR curses "," |
| 96 |
4.4BSD |
| 97 |
.IR curses "," |
| 98 |
or any other previous |
| 99 |
.I curses |
| 100 |
implementation. |
| 101 |
.SH PORTABILITY |
| 102 |
Applications employing |
| 103 |
.I \%ncurses |
| 104 |
extensions should condition their use on the visibility of the |
| 105 |
.B \%NCURSES_VERSION |
| 106 |
preprocessor macro. |
| 107 |
.PP |
| 108 |
NetBSD |
| 109 |
.I curses |
| 110 |
adopted |
| 111 |
.I \%wresize |
| 112 |
in 2001 (release 1.5.3), |
| 113 |
and |
| 114 |
.I \%PDCurses |
| 115 |
in 2004 (version 2.7). |
| 116 |
.PP |
| 117 |
It is not possible to resize windows with SVr4 |
| 118 |
.IR curses "." |
| 119 |
.SH HISTORY |
| 120 |
Thomas Dickey developed |
| 121 |
.I \%wresize |
| 122 |
as an extension to BSD |
| 123 |
.I curses |
| 124 |
in 1988, |
| 125 |
and brought it to |
| 126 |
.I \%ncurses |
| 127 |
in mid-1995. |
| 128 |
.SH AUTHORS |
| 129 |
Thomas Dickey |
| 130 |
.SH SEE ALSO |
| 131 |
\fB\%resizeterm\fP(3NCURSES) |