curses_intro.3x (2010 09)
c
curses_intro(3X) curses_intro(3X)
(X/Open CURSES)
Window Properties
Associated with each window are the following properties that affect the placing of characters into the
window (see Rendition of Characters Placed into a Window ).
Window Rendition
Each window has a rendition, which is separate from the rendition component of the window’s back-
ground 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 situa-
tions 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
cursor 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 charac-
ters to replace (overwrite) characters already in the window. If these functions specify only nonspacing
characters, they are appended to a spacing character already in the window; see also Nonspacing Charac-
ters (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 charac-
ter 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.
HP-UX 11i Version 3: September 2010 − 7 − Hewlett-Packard Company 7