Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!tcs!devorah!victor From: victor@devorah.tcs.com (Victor Elkind) Newsgroups: comp.windows.x.motif Subject: Button clicks in motif Message-ID: <1586@tcs.tcs.com> Date: 23 Jan 91 20:57:01 GMT Sender: root@tcs.com Reply-To: victor@devorah.tcs.com (Victor Elkind) Organization: Teknekron Communications Systems Lines: 58 I want to invoke different methods in my application based on various button clicks on a motif widget, ie shift-Click1, doubleClick1, click2, shift-Click2, etc. I can see only two ways to do this. 1) Change the widget's translation table to call the activateCallback for all the click combinations that I am interested in, and then check the XEvent structure passed in the activateCallback routine for which buttons were pressed to cause this callback and call the appropriate method in my application. 2) Add new callbacks (reasons) to a widget and specify which key/button combinations cause this callback to be invoked. Can this be done without creating a widget subclass? I am using Motif 1.0 and UIL. Can anybody suggest a better way to do what I want or which way is easier (1 or 2)? I tried the approach #1 by changing XmNtranslations for a DrawnButton widget in UIL, however, when I ran the sample program, the button only responded to clicks of Btn 1 but not to clicks of Btn 2. Here is a fragment of my uil file. object Symbol : XmDrawnButton widget { arguments { XmNbackgroundPixmap = xbitmapfile(sym_bm); XmNrecomputeSize = false; XmNtraversalOn = false; XmNlabelString = ''; XmNx = 5; XmNy = 5; XmNwidth = 50; XmNheight = 50; XmNpushButtonEnabled = true; XmNtranslations = translation_table( '#replace', ': Arm()', ',: Activate() Disarm()', ',: Activate() Disarm()', '(2+): Arm()', '(2+): Activate()', ': Activate() Disarm()', ': Arm()', ',: Activate() Disarm()', ',: Activate() Disarm()', '(2+): Arm()', '(2+): Activate()', ': Activate() Disarm()' ); }; Does anyone have any suggestions on why this does not work? Please, email your replies to victor@tcs.com. Many thanks in advance. Victor