|
I'm having problems with a popup menu. I have
a form which
happens to contain some labels. It also has
an event handler
attached to it which detects a right mouse button
press and
pops up a popup menu.
If you right click on one of the label children,
the event ends
up going to the form which handles the click by
popping up
the menu.
The menu is popped up by managing the
XmRowColumn,
which eventually gets to _XmXtMenuPopup in MenuShell.c
When the menu pops down, it eventually gets to line
841 in
MenuShell.c, which gets the "real" parent of the
menu shell
(the XmForm that popped it up) and calls
XtUngrabButton and
XtUngrabKeyboard on it.
From this point on, any mouse clicks on the labels
end up
getting routed to the label which ignores them
instead of
going to the form. If I comment out the two
XtUngrabs at
line 840 of MenuShell.c, everything seems to work
as expected.
I don't understand the ramifications of this
though. Clearly
those ungrabs are there for a reason. There's
some debug
message about EMACS and a comment /* XXXX 761607
*/
there, so they must have been added to fix
something.
I noticed that a few lines up, it would call
_XmXtMenuPopdown
if MS_PrivateShell() was set, but it's not.
If I force it to take
that path, it also works. Since the popup was
done through
_XmXtMenuPopup, it seems logical that it should go
this way.
MS_PrivateShell() seems to only be set to true for
menu bars
which share a shell
Any suggestions on this?
-- Dave Williss
------ Meddle not in the affairs of dragons, for you are crunchy and taste good with catsup |
