Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!spool.mu.edu!uunet!bywater!arnor!larios!db3l From: db3l@arnor.UUCP (David Bolen) Newsgroups: comp.windows.x.motif Subject: Re: Default action (double click) in XmList Message-ID: Date: 14 Mar 91 00:22:17 GMT References: <1991Mar12.062359.15814@wlbr.imsd.contel.com> Sender: news@arnor.uucp (NNTP News Poster) Distribution: na Organization: Laboratory Automation, IBM Thomas J. Watson Research Center Lines: 39 In-Reply-To: amc@wlv.imsd.contel.com's message of 12 Mar 91 06:23:59 GMT In article <1991Mar12.062359.15814@wlbr.imsd.contel.com> amc@wlv.imsd.contel.com (Allen M. Cohen) writes: >Can somebody tell me what type of translation or accelerator I can use to >make single clicking mouse button 2 or 3 have the same affect as double- >clicking mouse button 1? I am using a Multiple Selection List Widget. Here's a small snippet of code I used to do just that. I also (and users of my package) found double clicking difficult - especially across the network, so I just made this a part of any listbox I created. Now pressing button 2 (the middle button on my mouse) is the same as a double click. /* Declare these variables - change names at will */ XtTranslations _osUCtlLBTransTable; char _osUCtlLBTranslations[] = ": ListElementSelect()" " ListElementUnSelect()" " ListElementSelect()" " ListElementUnSelect()"; /* Do this once somewhere during initialization */ _osUCtlLBTransTable = XtParseTranslationTable(_osUCtlLBTranslations); /* Then after creating the list widget */ XtOverrideTranslations(listwidget,_osUCtlLBTransTable); -- -- David -- /-----------------------------------------------------------------------\ \ David Bolen / | Laboratory Automation, IBM Thomas J. Watson Research Center | / P.O. Box 218, Yorktown Heights, NY 10598 \ | - - - - - - - - - - - - M i t h r a n d i r - - - - - - - - - - - - | | Internet : db3l@ibm.com | Bitnet : db3l@yktvmv | | Usenet : uunet!bywater!arnor!larios!db3l | Phone : (914) 945-1940 | | /---------------------------------------------------------------\ | \-( All comments/opinions are mine and don't represent those of IBM )-/ \---------------------------------------------------------------/