Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: converse@expo.lcs.mit.EDU (Donna Converse) Newsgroups: comp.windows.x Subject: Re: Restoring a widget's default translations Message-ID: <9104191458.AA10004@excess.lcs.mit.edu> Date: 19 Apr 91 14:58:36 GMT References: Sender: daemon@athena.mit.edu (Mr Background) Organization: X Consortium, MIT Laboratory for Computer Science Lines: 35 > Is there a way to restore a widget's default translations? No, I don't see how an application can force the installation of the widget class's default translations onto an instance of that class. Yes, you can do XtGetValues on the translations resource of a widget, save the returned value, and later use XtSetValues to restore those translations on that widget. These translations might include translations specified by the user or by the application writer. If you have a specific set of translations to restore on multiple widgets, compile them once with XtParseTranslations and use the returned value with XtSetValues on multiple widget instances, multiple times, to restore that set of translations. In fact, this is the best way to rotate through modal translations. Some applications might be calling XtParseTranslations and XtAugment or OverrideTranslations within a callback or an action procedure. These applications may show memory usage growth without bound as they cycle through changes in translations. Calling XtParseTranslations more than once on the same string is wasteful, and successively calling XtOverrideTranslations or XtAugmentTranslations to merge translations on mode changes can be exceedingly wasteful. Essentially the same points hold for accelerators. > I could maybe hack it by instancing > another widget of the same type and grabbing its translations resource Hmm, read the specification; I'm not convinced that this is supported. Donna Converse