Path: utzoo!attcan!uunet!snorkelwacker!usc!zaphod.mps.ohio-state.edu!math.lsa.umich.edu!math.lsa.umich.edu!emv From: van@HELIOS.EE.LBL.GOV (Van Jacobson) Newsgroups: comp.archives Subject: [xpert] Re: Cascading SimpleMenuWidgets Message-ID: <1990May30.152217.7628@math.lsa.umich.edu> Date: 30 May 90 15:22:17 GMT Sender: emv@math.lsa.umich.edu (Edward Vielmetti) Reply-To: van@HELIOS.EE.LBL.GOV (Van Jacobson) Followup-To: comp.windows.x Organization: University of Michigan, Department of Mathematics Lines: 68 Approved: emv@math.lsa.umich.edu (Edward Vielmetti) X-Original-Newsgroups: comp.windows.x Archive-name: smemenu/30-May-90 Original-posting-by: van@HELIOS.EE.LBL.GOV (Van Jacobson) Original-subject: Re: Cascading SimpleMenuWidgets Archive-site: ftp.ee.lbl.gov [128.3.254.68] Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti) I did a simple menu entry object that allows you to cascade SimpleMenuWidgets. It's call is essentially identical to SmeBSB but requires one more argument, XtNmenu, that's the name of the menu to be popped up when this entry is highlighted. The code is available for anonymous ftp from ftp.ee.lbl.gov (128.3.254.68), file SmeMenu.tar.Z. Attached is a copy of the README from the tarchive. - Van ----------------- README for Simple Menu Entry `Menu' object, SMEMenu. Wed May 30 02:04:17 PDT 1990 This tar contains a new `simple menu' object for the Athena widget set that allows hierarchical menus to be built. There are four files: SmeMenu.c the `menu' simple menu entry object SmeMenu.h user visible definitions for above SmeMenuP.h private definitions for above SimpleMenu.c slightly modified simple menu widget. main change was to make XawPositionSimpleMenu action externally visible (so user written programs could position menus) and re-implement it (without changing semantics) so its lower level routines could be used by SmeMenu to position a popped-up menu correctly. Use --- SmeMenu is almost identical to SmeBSB and takes all the same label, bitmap, etc., arguments. There are two args added: XtNmenu is the name of the menu to be popped up when this menu entry is selected. This must be the name of a SimpleMenu widget. This argument must be supplied. XtNpopupSelection is a boolean that, if true, causes the popped up menu to be positioned at the last selected entry. If false (the default), the popped up menu is positioned at its label. Bugs ---- Probably. But there's only one that I know of: The toolkit event logic doesn't seem to handle modal cascades very well and you will occasionally get the message "Warning: XtRemoveGrab asked to remove a widget not on the list" in well defined circumstances that I won't attempt to describe here. This appears to me to be a toolkit bug but, rather than embark on a major recoding effort to fix it, I just commented the above warning out in Xt/Event.c:RemoteGrab. - Van Jacobson, van@helios.ee.lbl.gov Lawrence Berkeley Laboratory