HP 9000 Series 300 Tutorials Manual page 219

Device i/o and user interfacing hp-ux concepts and tutorials
Hide thumbs Also See for HP 9000 Series 300:
Table of Contents

Advertisement

A full set of windows and options must be maintained for each terminal
according to program needs. Each terminal must be initialized separately with
its own newterm call. Options such as cbreak and noecho, and functions such
as endwin and refresh must be set (or called) separately for each terminal.
Here is a typical scenario for sending a message to each terminal:
for (i=O; i <nterm; i++) {
set_term(terms[i]);
mvaddstr(O.O."Important message");
refreshO;
}
The sample program two at the end of this tutorial contains a full example of
how this technique is implemented. The program pages through a file, showing
one page to the first terminal; the next page to the second. It then waits for
a space character to be typed on either terminal, then sends the next page
to the terminal that sent the space character. Each terminal has to be put
into nodelay mode separately. No standard multiplexer is available in current
HP-UX versions, so it is necessary to busy wait or call sleep(l); between each
check for keyboard input. two waits one second between checks for available
terminal keyboard characters.
two is only a simple example of two-terminal curses. It does not handle
notification as described above; instead, it requires the name and type of the
second terminal on the program procedure line. As written, two requires that
the command sleep 100000 be typed on the second terminal to put it to sleep
while the program runs, and the the first-terminal user must have read and
write permission on the second terminal.
Low-Level Terminfo Usage
Some programs need access to lower-level primitives than those offered by
curses. For such programs, the terminfo-Ievel interface is provided. This
interface does not manage the CRT screen, but gives programs access to strings
and capabilities that can be used to manipulate the terminal.
Use of terminfo-Ievel routines is discouraged. Whenever possible, higher-level
curses routines should be used instead, in order to maintain portability to
USing Curses and Terminfo
1-21

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents