:Apologies if this is a FAQ or otherwise stupid question.
:
:I want to put together a vt100 menuing system with as little
:pain as possible. Is there one I can steal from somewhere?
:Is this something I should try and do in perl or some other
:programming environment?
:
:Ideally, I would like something that would look at a section
:of a directory tree and offer the options in the tree as numbered
:menu choices (a la Gopher.) Then, depending on whether the user
:chose a shell script, a program, a data file, or a subdirectory,
:this ideal menu system would do the Right Thing.
:
:Is there any place I can start looking? This seems like the kind of
:thing someone would have done.
uses curseperl, a perl binary that's been linked with curses.. It's
available in menu.pl.shar from /pub/perl/misc coombs.anu.edu.au via
anonymous FTP.
Adverti*t from distribution follows....
--tom
This is a new/improved distribution of my "menu.pl" package.
The current version is "menu.pl version 1.3". The last version I
distributed via "comp.lang.perl" was version 1.1.
For PREVIOUS users of "menu.pl", this version contains bug fixes, "top" level
menu support, "latched" (remembered) menu position support, and (maybe most
important) a user document for the routines. This version is compatible
with all old calls (so your old code should still work with the new
package).
For NEW menu.pl package users (from the top of MENU_DOC) ...
--------
Overview
--------
The "menu.pl" package is a perl package (built into your perl program
with a "require menu.pl" command) that automates curses-based full screen
menus. Using three simple calls, any number of items may be selected from a
single or multiple-page menu by moving an arrow to the desired item or
directly entering the selection number displayed on the screen. Paging
through multiple-page menus is handled automatically. Menu titles and
prompts are supported.
The "menu.pl" package uses curses interface routine calls supplied by the
"curseperl" package. The "curseperl" package is distributed with the normal
perl distribution in the "usub" directory. The "curseperl" binary is a
complete perl interpreter with the addition of many "curses" routines
dealing with screen manipulation (cursor positioning, display of text at the
current cursor location, etc). Applications using "menu.pl" must be
constructed to use "curseperl" instead of "perl".
Most applications using perl menus will use the following three calls
(with the "menu_item" routine used multiple times to provide the menu
selections) as follows:
#!/usr/bin/curseperl
...
&menu_init(1,"Select an Animal"); # Init menu
&menu_item("Collie","dog"); # Add item
&menu_item("Shetland","pony"); # Add item
&menu_item("Persian","cat"); # Add last item
$sel = &menu_display("Which animal?"); # Get user selection
if ($sel eq "dog") { ... }
...
--
- Real programmers are a figment of the imagination.