HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)

c
curses_intro(3X) curses_intro(3X)
(X/Open CURSES)
Window Rendition
Each window has a rendition, which is separate from the rendition component of the window’s background
property described below.
Window Background
Each window has a background property. The background property specifies:
A spacing complex character (the background character) that will be used in a variety of situations
where visible information is deleted from the screen.
A rendition to use in displaying the background character in those situations, and in other situations
specified in Rendition of Characters Placed into a Window.
Conceptual Operations
Screen Addressing
Many Curses functions use a coordinate pair. In the DESCRIPTION, coordinate locations are represented
as (y, x) since the y argument always precedes the x argument in the function call. These coordinates
denote a line/column position, not a character position.
The coordinate y always refers to the row (of the window), and x always refers to the column. The first row
and the first column is number 0, not 1. The position (0, 0) is the window’s origin.
For example, for terminals that display the ISO 8859-1 character set (with left-to-right writing), (0, 0)
represents the upper lefthand corner of the screen.
Functions that start with
mv take arguments that specify a (y, x) position and move the cursor (as though
move() were called) before performing the requested action. As part of the requested action, further cur-
sor movement may occur, specified on the respective reference manpage.
Basic Character Operations
Adding (Overwriting)
The Curses functions that contain the word add, such as addch(), actually specify one or more characters
to replace (overwrite) characters already in the window. If these functions specify only nonspacing charac-
ters, they are appended to a spacing character already in the window; see also Nonspacing Characters
(ENHANCED CURSES).
When replacing a multicolumn character with a character that requires fewer columns, the new character
is added starting at the specified or implied column position. All columns that the former multicolumn
character occupied that the new character does not require are orphaned columns, which are filled using
the background character and rendition.
Replacing a character with a character that requires more columns also replaces one or more subsequent
characters on the line. This process may also produce orphaned columns.
Truncation, Wrapping and Scrolling
If the application specifies a character or a string of characters such that writing them to a window would
extend beyond the end of the line (for example, if the application tries to deposit any multicolumn character
at the last column in a line), the behaviour depends on whether the function supports line wrapping:
If the function does not wrap, it fails.
If the function wraps, then it places one or more characters in the window at the start of the next line,
beginning with the first character that would not completely fit on the original line.
If the final character on the line is a multicolumn character that does not completely fit on the line,
the entire character wraps to the next line and columns at the end of the original line may be
orphaned.
If the original line was the last line in the window, the wrap may cause a scroll to occur:
If scrolling is enabled, a scroll occurs. The contents of the first line of the window are lost. The
contents of each remaining line in the window move to the previous line. The last line of the
window is filled with any characters that wrapped. Any remaining space on the last line is filled
with the background character and rendition.
If scrolling is disabled, any characters that would extend beyond the last column of the last line
are truncated.
252 Hewlett-Packard Company 7 HP-UX 11i Version 3: February 2007