🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.misc
Article #699

Why I couldn't popup different menus by three buttons???

#699
From: Qing Zhang
Date: Wed, 26 Jun 1991 08:13
68 lines
2355 bytes
Newsgroups: window
Subject: WHY  ONLY POPUP ONE menu with three buttons in MOTIF???
Summary: 
Followup-To: 
Distribution: 
Organization: University of Hawaii at Manoa
Keywords: 

Hello,

I am working a graphic editor. I have been trying to use three buttons by
DEPRESSING ONE OF THEM to popup different popup editing menu within the 
drawingarea. But I only can get one popuped, no second one showed.

What I did is sketched as follows (using the XtAddEventHandler() similar 
approaches like action table can be the same.).
 
main(){
   ...
   create_popupmenu1(drawingarea);
   create_popupmenu2(...);
   create_popupmenu3(...);
   ...
}

create_popupmenu1(){
   popup1 = XmCreatePopupMenu(drawingarea, "popup1", al, ac);
   ... here create title, separator and buttons as children of popup1.
   XtAddEventHandler(drawingarea, ..., PostPupup, popup1);
   ... and XtManageChildren.
}


create_popupmenu2(){
   popup2 = XmCreatePopupMenu(drawingarea, "popup2", al, ac);
   ... here create title, separator and buttons as children of popup1.
   XtAddEventHandler(drawingarea, ..., PostPupup, popup2);
   ... and XtManageChildren.
}

   
PostPopup(w, popup, event)
...
{
    switch(event->button){
         case Button3: 
             case Button3:
             XmMenuPosition(popup3, event);
             XtManageChild (popup3);
             break;
        case Button2:
             XmMenuPosition(popup2, event);
             XtManageChild (popup2);
             break;
        default:
            not available
    }
}

Can any one help me what the problem is? The fuuny thing is if I press the 
MIDDLE BUTTON, no response. When I press button1, the noavailabel message
was printed.

WhY That? Thanks.

---Thomas Y, Huang

 
Technical Details
Message-ID: <13653@uhccux.uhcc.Hawaii.Edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!uhccux!uhunix1.uhcc.Hawaii.Edu!qzhang

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!uhccux!uhunix1.uhcc.Hawaii.Edu!qzhang
From: qzhang@uhunix1.uhcc.Hawaii.Edu (Qing Zhang)
Newsgroups: comp.windows.misc,comp.windows.ms,comp.windows.ms.programmer
Subject: Why I couldn't popup different menus by three buttons???
Message-ID: <13653@uhccux.uhcc.Hawaii.Edu>
Date: 26 Jun 91 08:13:09 GMT
Sender: news@uhccux.uhcc.Hawaii.Edu
Followup-To: comp.windows.misc
Distribution: usa
Organization: University of Hawaii at Manoa
Lines: 68