yhuang@wiliki.eng.hawaii.EDU (Thomas Huang) (06/26/91)
Hello Xperts
I programmed in Xt before. Now I am working on a graphic editor in MOTIF.
I am trying to press the right button in the DrawingArea to popup a Edit
menu (Very similar to the idea in XFIG.). But it just does not react at all.
Procedures followed:-
void EditPopup()
{
popup = XmcreatePopupMenu (DrawingArea, "edit_popup", wargs, n);
... Here create the label and pushbuttons as the children of the popup
XtAddEventHandler(DrawArea, ButtonPressMask, False, PostIt, popup);
XtManageChildren(popup_buttons, num_buttons);
}
And the event handler is as follows:
void PostIt (w, popup, event)
Widget w;
Widget popup;
XButtonEvent * event;
{
if (event->button != Button3)
return;
XmMenuPosition(popup, event);
XtManageChild (popup);
}
Would anyone advise me why I could not make it work? I TRIED Other approach to
use action table. But that did not work either.
I appreciate your earlier reply. I was stopped here for two days already!!
Thanks.
My E-Mail: yhuang@bishop.ics.hawaii.edu OR
yhuang@wiliki.eng.hawaii.edu
--Thomas Y. Huang