Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!uswnvg!dmbeal From: dmbeal@uswnvg.UUCP (Dave Beal) Newsgroups: comp.windows.x.motif Subject: Botton events in motif 1.0 Keywords: buttons, motif, events Message-ID: <806@uswnvg.UUCP> Date: 13 May 91 15:23:36 GMT Organization: US West NewVector, Bellevue, Wash. Lines: 46 We are developing an application which involves having the user select one or more messages from a list of messages with button 1. When the user selects the messages, a popup menu appears with a menu of choices for the user to select from, each of which involves performing some action on the selected messages. We use a homebrew widget for the list of messages and can recognize a button 1 press and release. We manually manage (popup) the popup menu. Unfortunately, Motif calls for the default button on a popup to be button 3. We would like to use button 1 to limit the confusion factor for the poor user. Unfortunately, when we set the XmNwhichButton (apparently this becomes XmNmenuPost in motif 1.1) to switch the button, motif takes over complete control of button 1 and our homebrew widget never sees a button 1 press/release. We have come up with a work-around which involves using XtAddEventHandler to add event handlers for each pushbutton on the popup menu and not using the XmNwhichButton resource on the popup menu. In the event handler routine, we ignore all buttons except for button 1. It works the problem except that the only way to get the menu to pop down without making a selection is to move the pointer off the menu and hit button 3 (remember, we didn't change the default). Moving off the menu and pressing button 1 won't work the problem. You wouldn't expect it to because we just added event handlers to the pushbuttons in the menu. A button event in la-la land is never going to be seen by our event handler...only by the popup menu handler which only sees button 3. The question is, is there any way to make a popup menu use button 1 without taking over total control of button 1 when the menu is not popped up so that we can still use it in our homebrew widget? Or perhaps, is there another way of accomplishing the same thing using a different motif widget? Using button 3 in the popup is not really a viable option for us. Even with putting a "Use button 3" label at the top the popup it is confusing to the user. Also, not all mice have three buttons. Dave Beal U S WEST NewVector uunet!uswnvg!dmbeal