Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!husc6!umb!ileaf!io!hds From: hds@io.UUCP (H.David Scarbro) Newsgroups: comp.windows.x Subject: Re: How do I create popup menus with Xt? Message-ID: <676@io.UUCP> Date: 20 Jul 88 14:16:04 GMT Organization: Interleaf Inc, Cambridge, MA Lines: 45 The following is from Marvin Solomon's recent netnews message: >One final problem is how to make the popup menu go way if the user doesn't >choose any of its options. I still haven't got that to work, but I have >one more trick I might try: Define a translation for LeaveWindow on the >Box widget containing the menu. Right now, if I pop up the menu with a button >press and then release the button somewhere other than one of the menu items, >the menu stays popped up. If I go back and click in one of the menu items, >the corresponding action is taken and the menu goes away. Curiously enough, >there doesn't seem to be any grab active: I can still activate other buttons >in the menu bar. All this despite that fact that the builtin action for >MenuPopup() sets "spring-loaded" and (so far as I can make out) does an >exclusive grab. The same thing happend if I use XtCallbackExclusive() >instead of MenuPopup() to raise the menu. Only in this case, the menu does >not "feel" the mouse until I release the button for the first time. The following is from Ralph Swick's response: > The popup support in Xt does work. There are some kinks that will be > smoothed out in R3, as well as widgets which have more mechanism > (and less policy :-) for using the popup support in Xt. Using Marvin's example program, I found one of the "kinks" with MenuPopup(). The line in XtConvertStringToBoolean() in TMstate.c which is currently: *bP = (Boolean) *(int *)toVal.addr; should read: *bP = *(Boolean*)toVal.addr; By ironing out this "kink" and adding an override to call MenuPopdown() on I made Marvin's example program work correctly. This change doesn't fix the "kinks" in XtCallbackExclusive. From looking at this code, it appears there might be some state information that the translation manager is changing as a part of the MenuPopup() that needs to be changed when XtCallbackExclusive() is called. I've already sent the MenuPopup() fix to xbugs. ---- David Scarbro UUCP: ..!{sun!sunne,mit-eddie}!ileaf!hds Interleaf, Inc. Internet: hds@ileaf.com Ten Canal Park Phone: (617)577-9800 x6608 Cambridge, MA 02141