These functions create, modify and delete windows on the current screen.
The contents of a window may be copied to another window by using the
copywin() function, a section of the destination window
dest bounded by
(dminrow,
dmincol) and
(dmaxrow,
dmaxcol) will be overwritten with the contents of the window
source starting at the coordinates
(sminrow,
smincol). If the
overlay flag is
TRUE then only non-blank characters from
source will be copied to
dest, if
overlay is
FALSE then all characters from
source will be copied to
dest. If the bounding rectangles of either the source or the destination windows lay outside the maximum size of the respective windows then the size of the window copied will be adjusted to be within the bounds of both the source and destination windows.
The
dupwin() function creates an exact duplicate of
win and returns a pointer to it.
Calling
derwin() will create a subwindow of
win in the same manner as
subwin() excepting that the starting column and row
y,
x are relative to the parent window origin.
A window may deleted and all resources freed by calling the
delwin() function with the pointer to the window to be deleted in
win.
A window can be moved to a new position by calling the
mvwin() function. The
y and
x positions are the new origin of the window on the screen. If the new position would cause the any part of the window to lie outside the screen, it is an error and the window is not moved.
A subwindow can be moved relative to the parent window by calling the
mvderwin() function, the
y and
x positions are relative to the origin of the parent window. If the given window in
win is not a subwindow then an error will be returned. If the new position would cause the any part of the window to lie outside the parent window, it is an error and the window is not moved.
The
newwin() function creates a new window of size
lines,
cols with an origin at
begin_y,
begin_x. If
lines is less than or equal to zero then the number of rows for the window is set to
LINES - begin_x +
lines. Similarly if
cols is less than or equal to zero then the number of columns for the window is set to
COLS - begin_y +
cols.
subwin() is similar to
newwin() excepting that the size of the subwindow is bounded by the parent window
win. The subwindow shares internal data structures with the parent window and will be refreshed when the parent window is refreshed. The subwindow inherits the background character and attributes of the parent window.
The
overlay() function copies the contents of the source window
source to the destination window
dest, only the characters that are not the background character in the source window are copied to the destination. The windows need not be the same size, only the overlapping portion of both windows will be copied. The
overwrite() function performs the same functions as
overlay() excepting that characters from the source window are copied to the destination without exception.
wresize() resizes the specified window to the new number of lines and columns given, all internal curses structures are resized. Any subwindows of the specified window will also be resized if any part of them falls outside the new parent window size. The application must redraw the window after it has been resized. Note that
curscr and
stdscr can not be resized to be larger than the size of the screen.