This is an extension to the
curses library.
It provides callers with a hook into the
ncurses data to resize
windows,
primarily for use by programs running in an X Window terminal (e.g., xterm)
when the terminal's screen size is changed by the user:
|
»
|
curses windows cannot extend outside the screen.
If the terminal is shrunk, curses windows must be shrunk to fit.
|
|
»
|
If the terminal is stretched,
rows and/or columns can be added to existing windows.
The added cells should match the current attributes of the windows.
|
If the calling program has not set up a handler for
SIGWINCH
when it initializes
ncurses
(e.g., using
initscr(3X) or
newterm(3X)),
then
ncurses sets a handler for
SIGWINCH which notifies
the library when a window-size event has occurred.
The library checks for this notification
|
»
|
when reading input data,
|
|
»
|
when implicitly resuming program mode
(e.g., between endwin(3X) and wrefresh(3X)),
and
|
|
»
|
when explicitly resuming program mode in restartterm(3X).
|
When the library has found that the terminal's window-size has
changed, it calls
resizeterm to update its data structures.
An application which establishes its own SIGWINCH handler
can call resizeterm, but in that case, the library will not
see SIGWINCH, and proper layout will rely upon the application.