Newt
has a definite design philosophy behind it, and knowing that design
makes it significantly easier to craft robust newt
applications. This
tutorial documents newt
0.30 --- older versions of newt
had
annoying inconsistencies in it (which writing this tutorial pointed out),
which were removed while this tutorial was written. The latest version of
newt
is always available from Red Hat.
Newt
was originally designed for use in the install code for
Red Hat Linux. As this install code runs in an environment with limited
resources (most importantly limited filesystem space), newt
's size
was immediately an issue. To help minimize its size, the following design
decisions were made early in its implementation:
newt
does not use an event-driven architecture.
newt
is written in C, not C++. While there has been interest
in constructing C++ wrapper classes around the newt
API, nothing has
yet come of those ideas.
Windows must be created and destroyed as a stack (in other words, all
newt
windows behave as modal dialogs). This is probably
the greatest functionality restriction of newt
.
The tty keyboard is the only supported input device.
Many behaviours, such as widget traversal order, are difficult or impossible to change.
While newt
provides a complete API, it does not handle the low-level
screen drawing itself. Instead, newt
is layered on top of the screen
management capabilities of John E. Davis's
S-Lang library.