[comp.windows.x] Xaw Text widget Scrollbar resources

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (04/13/90)

> I want the middle button to pop up a cut/paste/snarf/find menu for editing.
> This works fine when in the text widget, but it also pops up when I'm in
> the scrollbars, thus disabling the ability to use the middle button for
> scrolling.

Make sure that you use Text.Translations instead of Text*Translations since the
scrollbar is a child of the Text widget.

> I would like a double-click on left button to invoke MY select word routine,
> PickWord(), rather than the default, so I can make it do things like match
> parens, etc.  When I do the following, I can no longer drag to select text.

> String fallback_resources[] = { 
>        "*Text.Translations:            #override \\n\
>                                        <Btn1Down>:     select-start() \\n\
>                                        <Btn1Motion>:   extend-adjust() \\n\
>                                        <Btn1Up>(2):    PickWord() \\n\
>                                        <Btn2Down>:     XawPositionSimpleMenu(EditMenu) \
>                                                        EditHandler() \
>                                                        MenuPopup(EditMenu)  ",
>        NULL,
> };

In the Xt Spec in Appendix B (Translation Table Syntax) in the Fifth example it
states.

	If an event sequence consists of a sequence of events that is also a
	non-initial subsequence of another translation,
	it is not taken if it occurs in the context of the longer sequence.
	This occurs mostly in sequences like the following:

	<Btn1Down>,<Btn1Up> : toves()\\n\\
	<Btn1Up> :  did()

	The second translation is taken only if the button release is not
	preceded by a button press or if there are intervening events between
	the press and the release.  Be particularly aware of this when using 
	the repeat notation, above, with buttons and keys because their 
	expansion includes additional events, and when specifying motion events
	because they are implicitly included between any two other events.
 ****** In particular, pointer motion and double-click
 ******	translations cannot coexist in the same translation table. 

So it appears that the answer is don't do that.


						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213