home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!think.com!paperboy.osf.org!paperboy!drand
- From: drand@spinner.osf.org (Douglas S. Rand)
- Subject: Re: popping up a PopupMenu using Btn1
- In-Reply-To: tom@teal.csn.org's message of 19 Jan 93 22:06:10 GMT
- Message-ID: <DRAND.93Jan22131603@spinner.osf.org>
- Sender: news@osf.org (USENET News System)
- Organization: Open Software Foundation
- References: <C14G2D.Gvu@csn.org>
- Date: 22 Jan 93 13:16:03
- Lines: 43
-
- In article <C14G2D.Gvu@csn.org> tom@teal.csn.org (Tom Schutter) writes:
-
- I am constructing a toolbar where some buttons do actions when pushed, and
- others bring up popup menus. To make things consistent, I want the popup
- menus to come up with Btn1.
-
- I start with a RowColumn (of type XmWORK_AREA) with a number of PushButton
- children. An activate callback on each PushButton then either calls one of
- my action callbacks or calls XmMenuPosition and XtManageChild to popup a menu.
-
- This will not work properly unless you have at least 1.2.1. I believe
- it will work correctly with 1.2.1.
-
- The problem is that Btn1 pops the menu up, but only Btn3 will pop it down.
- According to O'Reilly #6, p 566, Motif makes a server grab and only releases
- the menu on a Btn3 release, no matter what event popped up the menu. It goes
- on to say that you can use XmNmenuPost to specify an alternate button to
- post the menu, but this is known to hang the server. I attempted it and caused
- the server to hang.
-
- menuPost (or the deprecated resource whichButton) specifies what button
- will cause the menu to post. For good or ill, the popdown also happens
- with this button (i.e. it is filtered on the button number and modifiers).
- It shouldn't hang the server, providing that you do actually post the
- menu in response to the button press. If this was on OpenWindows, then
- there *is* a known bug there.
-
- Does anyone know how to bypass this XmNmenuPost bug? Does Motif 1.2 solve this
- problem? Or is there a totally different tack that I can take?
- I have tried using PulldownMenus instead of Popup, but they must be attached
- to CascadeButtons, which must be children of MenuBars, Pulldowns, or Popups,
- each of which have their own shortcomings.
-
- I can't say for sure, but my expectation is that things will work
- much more as you would expect with 1.2.1. 1.2 still has a minor
- bug with posting menus from a random widget which was not planned
- for. The test case for the change was (in fact) posting a popup
- from an activate callback.
- --
- Douglas S. Rand <drand@osf.org> OSF/Motif Dev.
- Snail: 11 Cambridge Center, Cambridge, MA 02142
- Disclaimer: I don't know if OSF agrees with me... let's vote on it.
- Amateur Radio: KC1KJ
-