[comp.windows.x.motif] Problem with text-translations

roar@stud.cs.uit.no (Roar Steen) (06/01/91)

Description of desired functionality:

	I have a FormDialog (XmCreateFormDialog) with several
	children. Among these are some Text widgets, one as
	a direct child, and others placed inside a RowColumn.
	The Text that stands alone is supposed to call the
	activate() routine as soon as the user presses 
	<Key>Return. This is default when the Texts editMode
	is set to SINGLE_LINE_EDIT, which is the case here.
	The other Texts, placed inside the RowColumn also has
	their editMode set to SINGLE_LINE_EDIT, but here I
	want next-tab-group() called when the user presses
	<Key>Return as well as activate(). This sould not be
	a problem at all. I've set the following resource in
	the app-defaults file (examples follow, not the
	file as it actually appears):

	*XmText.editMode:		SINGLE_LINE_EDIT
	*XmText.translations:		#override \
					<Key>Return:	activate()
	The above was for the separate Text widget. For the ones in
	the RowColumn it looks like this:

	*XmRowColumn*XmText.editMode:	SINGLE_LINE_EDIT
	*XmRowColumn*XmText.translations:	#override \
					<Key>Return:	activate() \
							next-tab-group()

	Normally this should work fine!

Description of problem:
	
	The problem is this. When XmForm, which inherits resources from
	BulletinBoard, is a child of a DialogShell, its default 
	translations uses <Key>Return to activate the default button.
	So the BulletinBoard provides a resource called 
	XmNtextTranslations to help this situation. But this is not
	enough, the BulletinBoard still needs the Return key. So the
	manual says that you can set the translations of BulletinBoard
	in a way that it not uses the Return key, i.e.:

	*XmForm.translations:		#replace \
					<Key>F1:	Help() \n\
					<FocusIn>:	FocusIn().....

	and so on, leaving out <Key>Return. However this does not seem
	to work either. My problem is that I need different translations 
	for the Text widgets, so it's not sufficient to set the
	textTranslations of the XmForm. I don't want next-tab-group()
	called on the separate widget. Doing #replace all the way is to
	cumbersome.

Solution of problem:

	Well, I certainly don't have any! I've tried several workarounds,
	but nothing seems to do the trick. Preferrably I want to do this
	from the app-defaults file, so there's got to be an easy way.
	Any help in this matter will be appreciated. I'm currently 
	running X11R4 and Motif 1.0 on a HP900/425t.



-- 
//// Roar Steen                     // N-9000 TROMSOE, NORWAY              /
/// Department of Computer Science // Member of the "Drool Patrol"        //
// University of Tromsoe          // and "Hells Norskies"                ///
/ NORWAY                         // Email: roar@staff.cs.uit.no         ////