home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / x / motif / 8765 < prev    next >
Encoding:
Text File  |  1993-01-22  |  2.7 KB  |  56 lines

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