[comp.windows.x.motif] Easy way to change translations for all text widgets in an app?

sam@gyro.cc.ncsu.edu (Sam Moore) (02/27/91)

I would like to add an entry to my .Xdefaults to change the translations
for all of the text widgets in a specific application. Is there an easy
way of doing this. Currently I have setup a #define with the translations
that I want. I apply that definition to each text widget. I would like
to enter one line and have it affect all of the text widgets for this
application.

cem*messageText.translations:    #override\
        Ctrl<Key>f:     forward-character()\n\
        Ctrl<Key>b:     backward-character()\n\
        Meta<Key>f:     forward-word()\n\
        etc...

This is the way that I have been doing it. I would like to do something like:

cem*text.translations:  etc..


, and have all of the text widgets get these translations.

Is the only way to do this to name all of my text widgets the same thing,
say "text", and then make sure that no two have the same container hierarchy?
Currently I name my widgets by what they are like messageText, above. I
have not been able to wildcard with a widget name, so I can't have all of
my text widgets end in Text and then match for there names with somthing like:

cem*Text.translation: etc...

I have also tried:

cem*textTranslations: etc...

,and:

*textTranslations: etc...

Thanks,

Sam
--
------------------------------------------------------------------------------  
        | Sam Moore | Sam_Moore@ncsu.edu | NCSU Computing Center | 
------------------------------------------------------------------------------

paulo@nff.ncl.omron.co.jp (Paulo Pereira) (03/01/91)

In article <1991Feb27.155939.22542@ncsu.edu> sam@gyro.cc.ncsu.edu (Sam Moore) writes:

  I would like to add an entry to my .Xdefaults to change the translations
  for all of the text widgets in a specific application.
  
  cem*messageText.translations:    #override\
  	  Ctrl<Key>f:     forward-character()\n\
  	  Ctrl<Key>b:     backward-character()\n\
  	  Meta<Key>f:     forward-word()\n\
  	  etc...
  
  This is the way that I have been doing it. I would like to do something like:
  cem*text.translations:  etc..
  , and have all of the text widgets get these translations.
  
I use something like:

cem*XmText*translations:  etc..
cem*XmTextField*translations:  etc..

Paulo Pereira
OMRON Corporation, Kyoto, Japan
paulo@nff.ncl.omron.co.jp

gjf00@duts.ccc.amdahl.com (Gordon Freedman) (03/02/91)

In article <1991Feb27.155939.22542@ncsu.edu> sam@gyro.cc.ncsu.edu (Sam Moore) writes:
>I would like to add an entry to my .Xdefaults to change the translations
>for all of the text widgets in a specific application. Is there an easy
>way of doing this. Currently I have setup a #define with the translations
>that I want. I apply that definition to each text widget. I would like
>to enter one line and have it affect all of the text widgets for this
>application.
>
>cem*messageText.translations:    #override\
>        Ctrl<Key>f:     forward-character()\n\
>        Ctrl<Key>b:     backward-character()\n\
>        Meta<Key>f:     forward-word()\n\
>        etc...
>
>This is the way that I have been doing it. I would like to do something like:
>
>cem*text.translations:  etc..
>
>Thanks,
>
>Sam
>--
>------------------------------------------------------------------------------  
>        | Sam Moore | Sam_Moore@ncsu.edu | NCSU Computing Center | 
>------------------------------------------------------------------------------

Try this:

cem*XmText.translations:	#override\
	Ctrl<Key>f:	forward-character()\n\
	etc...

Hope this works for you, I haven't tried this exact resource, but have
specified resources for classes using Xm<Class> to specify the class. 
--
Gordon Freedman: gjf00@duts.ccc.amdahl.com
Disclaimer: My opinions! Not my employers!

marbru@attc.UUCP (Martin Brunecky) (03/03/91)

In article <1991Feb27.155939.22542@ncsu.edu> sam@gyro.cc.ncsu.edu (Sam Moore) writes:
>I would like to add an entry to my .Xdefaults to change the translations
>for all of the text widgets in a specific application. Is there an easy

    Dont' do it in .Xdefaults, please. Use application-class resource
    files. Dumping resources into .Xdefaults is one of the worst habbits
    in X-world.

>way of doing this. Currently I have setup a #define with the translations
>that I want. I apply that definition to each text widget. I would like
>to enter one line and have it affect all of the text widgets for this
>application.
>
>cem*messageText.translations:    #override\
>        Ctrl<Key>f:     forward-character()\n\
>        etc...
>
Have you tried:

cem*XmText.translations: ....

(where XmText is the *class* name of the text widget, note that text
 field is a different class ... )


-- 
=*= Opinions presented here are solely of my own and not those of Auto-trol =*=
Martin Brunecky                           {...}sunpeaks!auto-trol!marbru
(303) 252-2499                        (sometimes also:  marbru@auto-trol.COM )
Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404