HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
c
curses_intro(3X) curses_intro(3X)
(X/Open CURSES)
Initialised Curses Environment
Before executing an application that uses Curses, the terminal must be prepared as follows:
• If the terminal has hardware tab stops, they should be set.
• Any initialisation strings defined for the terminal must be output to the terminal.
The resulting state of the terminal must be compatible with the model of the terminal that Curses has, as
reflected in the terminal’s entry in the terminfo database (see terminfo(4)).
To initialise Curses, the application must call initscr() or newterm() before calling any of the other
functions that deal with windows and screens, and it must call endwin() before exiting. To get
character-at-a-time input without echoing (most interactive, screen-oriented programs want this), the fol-
lowing sequence should be used:
initscr();
cbreak();
noecho();
Most programs would additionally use the sequence:
nonl();
intrflush(
stdscr, FALSE);
keypad(
stdscr, TRUE);
Synchronous and Networked Asynchronous Terminals
This section indicates to the application writer some considerations to be borne in mind when driving syn-
chronous, networked asynchronous (NWA) or non-standard directly-connected asynchronous terminals.
Such terminals are often used in a mainframe environment and communicate to the host in block mode.
That is, the user types characters at the terminal then presses a special key to initiate transmission of the
characters to the host.
Frequently, although it may be possible to send arbitrary sized blocks to the host, it is not possible or desir-
able to cause a character to be transmitted with only a single keystroke.
This can cause severe problems to an application wishing to make use of single-character input; see Input
Processing in curses_intro.
Output
The Curses interface can be used in the normal way for all operations pertaining to output to the terminal,
with the possible exception that on some terminals the
refresh() routine may have to redraw the entire
screen contents in order to perform any update.
If it is additionally necessary to clear the screen before each such operation, the result could be undesirable.
Input
Because of the nature of operation of synchronous (block-mode) and NWA terminals, it might not be possi-
ble to support all or any of the Curses input functions. In particular, the following points should be noted:
• Single-character input might not be possible. It may be necessary to press a special key to cause
all characters typed at the terminal to be transmitted to the host.
• It is sometimes not possible to disable echo. Character echo may be performed directly by the
terminal. On terminals that behave in this way, any Curses application that performs input
should be aware that any characters typed will appear on the screen at wherever the cursor is
positioned. This does not necessarily correspond to the position of the cursor in the window.
SEE ALSO
curses(5).
Section 3−−126 − 14 − HP-UX Release 11i: December 2000
___
___