Ndialog

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 installer.

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 helpline (use_helpline(), get_helpline()), and by an imbedded mini-html browser that reads helpfiles. Also, if you’re running gpm, it supports pointing and clicking with an attached mouse.

Description

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

ndialog with BSD curses

while ncurses windows look like

ndialog with ncurses

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 keypad() support when built against versions of curses that don’t support that function.

Documentation

  1. Core functions
  2. Dialog-compatable functions
  3. New dialog functions
  4. Using ndialog in your applications

Source Code

1.0.4
And fast on the heels of 1.0.3 comes 1.0.4, where I worked over configure.sh to 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.
1.0.3
A few configuration tweaks to try and drag it into the bold new world of being usable by people other than me. I’ve updated the license to a 3-clause BSD license and have started tweaking the configuration environment so I will eventually be able to reliably generate a shared libndialog.
1.0.1
After quite a few years, I dragged ndialog out to do some debugging and discovered a few places where it was rather bugged. I don’t know if I’ve discovered the reported bug, but I found and fixed a few other bugs that were causing hilarious coredumps, so it’s time for a new release.
1.0
Ndialog hasn’t changed in a while, so there’s just one tarball with current sources