[comp.sys.hp] Problem with Popup Menus

victor@devorah.tcs.com (Victor Elkind) (03/25/91)

This article was also posted to the motif newsgroup.  I am posting it here
in case the problems have more to do with the HP workstation than Motif itself,
and perhaps someone reading this newsgroup has seen a similar problem.

Thanks in advance for any info.

I have a strange problem in that when I do XtManageChild(w) where w
is a popup menu, this menu gets stuck on the screen, and the entire workstation
stops responding to any & all mouse clicks.

I am using Motif 1.0 on an HP9000s300 (HP-UX 7.0) with UIL.  The Xserver
is X11R3.
The program is written in C++ and is compiled and linked with tools and
libraries provided by HP.

The very same code works just fine on the Sun SPARCstation.

I would appreciate any thoughts and/or comments on this situation.

Here is the thread of the code being executed.

Inside an event handler, check for Button3 press event.
If so, call the Popup method.
fmPopup::Popup(Widget parent,XButtonEvent *event)
//parent is the widget which received the button3 press event.
{
        if (fetched==false) {
                MrmType fmClass;
                Widget shellWidget;

                shellWidget = (Widget) XmCreatePopupMenu(parent, "name",
                                                         NULL,0);
//w is an instance variable of class fmPopup
                if (MrmFetchWidget(fmHier, "mapPopMenu", shellWidget, &w,
                                   &fmClass) != MrmSUCCESS) {
                        fmError("can't fetch popup %s\n",name);
                        return(false);
                }
                fetched = true;
        }

        XmMenuPosition(w,event);
        XtManageChild(w);
}

And finally, here is the fragment of the UIL file that is being fetched
by MrmFetchWidget in the code above.

object mapPopMenu : XmPopupMenu widget {
    arguments {
        XmNwhichButton = 3;
        XmNisHomogeneous = false ;
        XmNborderWidth = 0;
        XmNshadowThickness = 2;
        XmNbackground = color('snow4');
        XmNx = 0;
        XmNy = 0;
        XmNwidth = 219;
        XmNheight = 237;
    };
    controls {
        XmLabel SelectorLabel ;
        XmSeparator Separator20 ;
        XmPushButton FullViewPB ;
    };
    callbacks {
    };
};

I have tried to set whichButton resource to 4.  I have tried to change
XmPopupMenu to an XmRowColumn with XmNrowColumnType = XmMENU_POPUP, and
a combination of a few other things, got the popup up menu keeps screwing up.

Thanks in advance.  If possible, please email me directly (victor@tcs.com),
and I will post a summary of suggestions to the net.
----
Victor Elkind, Software Engineer      | victor@tcs.com or uunet!tcs!victor

The opinions expressed above are my own...

----
Victor Elkind, Software Engineer      | victor@tcs.com or uunet!tcs!victor

The opinions expressed above are my own...