From: andersen@liswsd.llnl.gov (Roger Andersen)
Newsgroups: comp.windows.x.motif
Subject: SUMMARY: Text File ==> Cascade Menu
Date: 8 Oct 92 21:03:00 GMT
Organization: LLNL_LIS

SUMMARY: Text File ==> Cascade Menu


I got four responses to my question, condensed below.  I didn't chase down
every recommendation, but it seemed as if what I was really looking for was
not to be found -- that is, an X application whose menu could be altered 
*without* an edit-compile-link iteration.

In the end, I decided that the problem was so unremarkable that it would  be as
fast to code it up as to cannibalize it out of lots of other pieces. So I stole
my buddy's linked list package, added some tree-building and  tree-walking,
munged the create_menus() function from Smith's new book, and voila -- an
application that can create a cascading menu based on a text file.

It's not anywhere near general-purpose, but if anybody wants to see it,
feel free to ask.

-- Roger Andersen


=============================================================================
From: cecchinr@gehrig.cs.rpi.edu (Ron Cecchini)
=============================================================================

I've written a utility that generates pure Motif code that implements
a menu bar from an indented file as you describe.  The only thing
thats different is that it names the callbacks itself based on the
location within the menu bar hierarchy where the option (that would
call the callback) is found.

I wrote it a few months ago, and its actually been used by a few people
where I work.  Basically, it generates a function that returns the
menubar widget.  So, you would just call this generated routine from
somewhere in your application and then do whatever.

What the utility does support right now is:
1) Separator and double-separators
2) Titles
3) Automatic recognition of the Help option

As an example of what kind of input it can take:

People
	"People"			<-- A title
	========			<-- A double-separator
	Men	
		Robert DeNiro
	---				<-- A separator
	Women
		Meryl Streep
Places
	"Places"			<-- A title
	==========			<-- A double-separator
	New York
	Massachusetts
Things
	"Things"			<-- A title
	========			<-- A double-separator
	Computer
	Book
	Pencil
Help
	Forget it, bud!


=============================================================================
From: dbl@osf.ORG (David B. Lewis)
=============================================================================

The Motif volume 6 in O'Reilly's series has pretty much what you want, although
the structure is defined in C structs (which have slots also for the labels and
names and other useful items).



=============================================================================
From: Mike Scheidler <c23mts@kocrsv01.delcoelect.COM>
=============================================================================

I have evaluated several programs which produce stand-alone menu applications.
These programs typically pop up a window full of buttons, let the user click
on one, then send a command to an application running in another window.  As
far as I know, nothing currently exists to encapsulate menu-building functions
in a user-written program (which is what I think you are planning to do).

You could probably get some ideas (and maybe borrow some code) from some of the
stand-alone menu programs I mentioned earlier.  Some program names to look for
are
	xtmenu
	xvmenu
	xmenu2
	xcmdpanel
	menupane
	bam

Try the /contrib directory at export.lcs.mit.edu, or use archie to look for
other sites.


=============================================================================
From: "Ivo (I.) Mokros" <mokros@bnr.ca>
=============================================================================

I read your posting in comp.windows.x.motif, if you checkout the
lex/yacc book from nutshell, one of the examples used is a menu
generator (albeit for ascii terminals, but it is a good starting
point).  The source is available on uunet in (I think) published/nutshell.

=============================================================================
=============================================================================
=============================================================================