[comp.windows.x] Menu widgets

ha@cs.purdue.EDU (Hiralal Agrawal) (03/02/89)

About three weeks back, I had posted a request to this news-group
inquiring about availability of any public-domain menu widgets under
X11R3. I received about fifteen replies. Thank you all for your help.
There was, as expected, a lot of overlapping information in these
replies. So instead of reproducing the replies here, I am simply
summarizing their suggestions as well as my findings here:

There was some confusion about the terminology. So let me first define 
the terms as I understand them:

Pulldown Menu:  A menu whose top-level items are permanently displayed
                in form of menu-buttons (horizontally or vertically). When
                the mouse is clicked on a menu item, the corresponding 
                sub-menu pops up.

Popup Menu:     A menu whose top-level items are NOT permanently displayed,
                but the top-level menu pops up when a particular mouse
                button is clicked (as in most window managers).

Cascading Menu: A menu where sub-menus can be associated with menu-items,
                and the sub-menus popup when mouse is moved out from the
                right-edge of the corresponding item-window. These menus
                are also referred to as walking menus. Note that both 
                pulldown and popup menus may support cascading sub-menus.

As for menu widgets, presently there are two options:

   1. Use the MenuBox widget, available in contrib/widgets/Xhp/MenuBox,
      compatible with Xaw widgets. This widget supports simple pulldown
      menus without cascading sub-menus. That is, each top-level menu 
      item can have an associated sub-menu, but none of the sub-menu 
      items can itself be a menu. (According to its README file, this
      widget is expected to be included in Xaw in the future.)

   2. Use popup menu widget of the Xhp widget set. HP widgets, as
      supplied, do not work correctly with R3. But a set of patches 
      (from Martin Friedmann) is available for anonymous ftp from
      expo.lcs.mit.edu under the file Xhp.patch.works.tar.Z. HP widget
      set supports pop-up menus with cascading sub-menus. The widget
      set shipped with R3 does NOT support pulldown menus (the R2 release
      did support pulldown menus; does some one know why have pulldown
      menus been pulled out from the R3 tape).
      
I tried out some simple programs with both these options. They seem
to work fine (so far!), but their run-time performance is really terrible, 
especially that of HP menu widgets. (I observed one problem with MenuBox
widget though -- after a sub-menu pops up and an item is selected, the
sub-menu goes away but the item window still remains highlighted with thick
borders; to unhighlight it I have to move the cursor in and out of that
item window!). 

HP widgets have an added advantage that they are a lot prettier than
Xaw widgets. The documentation for HP widgets is also a lot better if
you can obtain the full documentation directly from HP. The documentation
supplied with the R3 tape is in the form of simple ascii files without any 
figures. In place of figures, messages like the following appear:

                       PIC Illustration goes here.

Does some one know, how to obtain troff, tex, or postscript sources for
the HP widgets documentation?


Window managers like awm, twm, uwm all support menus, but they all are
implemented directly over Xlib. Abstracting only the menu-relevant 
code from them would be a nightmarish activity! Andrew toolkit also
provides menus, but they are not compatible with Xt intrinsics and widgets.


Acknowledgments: 
   I am thankfull to Alan Epstein, Martin Friedmann, Jim Fulton, Dany Guindi,
   Jordan Hubbard, Steve Hunt, Bill King, Sandeep Kochhar, Kris Olander,
   Panayiotis Papachiou, and Walter Poxon for their help.

-- Hiralal Agrawal
   ha@cs.purdue.edu

paul@torch.UUCP (Paul Andrews) (03/06/89)

ha@cs.purdue.EDU (Hiralal Agrawal) writes:

>Does some one know, how to obtain troff, tex, or postscript sources for
>the HP widgets documentation?

They were posted to comp.sources.x

mlr@comp.vuw.ac.nz (Martin Rothbaum) (06/25/89)

I am writing an X-toolkit application and would like to be able to
provide menus (be they popup or pull-down).

I have tried using the MenuBox widget supplied in contrib, but it
(even with the supplied menutest program) core dumps on several of our
machines (including an HP835 running HPUX 3.1, and a Pyramid running
OSx 4.0).

Does anyone out there know of fix(es) for it, or better still know the
whereabouts of a better widget?  Something with support for
hierachical menus (as in awm & twm) would be wonderful.

Thanks, 
--
   Martin Rothbaum (mlr@comp.vuw.ac.nz)          
   Dept. of Computer Science, Victoria University, NZ.