Jump to content

Newt (programming library)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 126.28.178.180 (talk) at 15:06, 16 September 2015 (External links: the link to the perl binding was dead and pointed to a non-canonical source. Updated with link from cpan.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Newt
Original author(s)Erik Troan, Red Hat engineer
Stable release
0.52.16 / August 6, 2013; 11 years ago (2013-08-06)
Written inC
Operating systemLinux, Cross-platform (Live CD)
Sizeabout 850 Kb when installed on i686 platform.
TypeWidget toolkit
LicenseGNU Lesser General Public License
WebsiteNewt page on Fedora

Newt is a programming library for color text mode, widget-based user interfaces. Newt can be used to add stacked windows, entry widgets, checkboxes, radio buttons, labels, plain text fields, scrollbars, etc., to text user interfaces. This package also contains the shared library needed by programs built with newt, as well as an application whiptail, which provides the most commonly used features of dialog. Newt is based on the slang library. It abbreviates from Not Erik's Windowing Toolkit.

Features

Newt was originally designed for use in the install code of Red Hat Linux and is written mostly focusing on clear interface, simplicity and small footprint.[1] Because of that, unlike most recent GUI engines, it does not use an event-driven architecture. Windows must be created and destroyed as a stack (the order of discarding is the exact opposite to that of creation). The top level window is always modal. Many behaviours, such as widget traversal order, are difficult or impossible to change.

These restrictions simplify the design of the library as well as the code of programs using it, though they impose limitations on user interface design.

Usage

The capabilities are fully adequate for the installation process, and Newt was used for the user friendly OS installers. It is also used in some system tools (like Partimage) that focus more on functionality than on looking attractive to the end user.

Interoperability

Newt is written in C. However, there are bindings to other languages.

Variants

gNewt project (no longer active) provides an alternative implementation that uses GTK instead of the text based interface. It is fully compatible with the official Newt implementation and can be replaced at run time, without recompilation. Like any other GTK components, gNewt controls can also use mouse input whereas the original Newt only supports the keyboard.

See also

  • nparted - Newt text interface for GNU Parted
  • Newt Syrup - Application framework based on Newt.
  • ncurses - the text interface library for which dialog was written in 1994

References