Ndialog is a outgrowth of some of the work I had been doing on building
installers for Linux, based on the installation program that comes with
FreeBSD. This installation program
used a greatly hacked-up version of the GPL'ed dialog library, with some
extra glue on it to support multiple items on a form. I tweaked it into
shape, converting the extra glue into a generalized
MENU() function, and
used it for a while in my own installers, and later in McAfee’s
WebShield installer. But, eventually I decided to write my own version;
first, because libdialog was GPLed, and I preferred to have a free dialog
library, and secondly because libdialog was a nonmodular pile of hackery,
made much worse by the tweaks I put into it to make it work with my
Ndialog is only superficially like libdialog. It has glue functions that
provide some libdialog functionality, but it is based on a wad of objects
that can be glued together and passed to a new (and totally incompatable)
MENU() function. It also supports online help, by both the existing dialog
get_helpline()), and by an imbedded
mini-html browser that reads helpfiles. Also, if you’re running
it supports pointing and clicking with an attached mouse.
Ndialog takes over the screen and breaks it into two windows; a helpline window, which is the botton line on the screen, for short reminders about what commands you can do (“F1 for help”, for example) and the rest of the screen for windows. Like libdialog, it’s kind of stupid about window sizing, but if you ask for an item that takes up too much real estate, the dialog functions will return an error code instead of exiting the program.
Ndialog should work with every version of curses out there; it works with ncurses (tested against ncurses 1.9.9, 4.0, and 4.1) and BSD curses (the ancient creaking version found in Linux libc 4). It looks and acts slightly differently on curses and ncurses; curses windows look like
while ncurses windows look like
In addition, ndialog doesn’t use
libpanel if it’s built against
curses, so windows sort of haphazardly pile on top of another.
One thing that does behave the same with curses and ncurses are
arrow keys – ndialog provides its own
when built against versions of curses that don’t support that
configure.shto clean up shared vs. non-shared library generation, the source to make it less whiny on newer versions of gcc/clang, and the makefile setup. This version properly generates shared and static libraries on macosx 10.12 (beta), FreeBSD 4.1, and at least one modern version of Debian Linux.