Xref: utzoo comp.windows.x.motif:343 comp.windows.x:25314 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ncar!elroy.jpl.nasa.gov!jarthur!uunet!sps!arm From: arm@sps.com (Annette Myjak) Newsgroups: comp.windows.x.motif,comp.windows.x Subject: SUMMARY: Return in Text Widget Message-ID: <261@sps.com> Date: 3 Aug 90 18:15:15 GMT Followup-To: comp.windows.x.motif Organization: SPS - Indialantic, FL Lines: 45 SUCCESS AT LAST!! THANKS to the many netters who offered suggestions on how to get this to work. Apparently, whenever some widget is the child of a bulletin board widget who just happens to be the child of a dialog shell, the bulletin board forces all of its children to translate to an "activate the default button" action. (This is a "feature".) Thus the reason that although a multiline text widget has = newline() in its translation table, the doesn't appear to work if the text widget is in a form dialog (as in my particular case). The solution is to override the translations to enable the text widget to recognize as a true (ie, newline). Special thanks to David Rudolph who supplied the following example code to show how to do this (as I found out, WHEN you do this is very important!) (This code is reproduced without David's permission. I hope he doesn't mind!) (in declarations) char newTrans[] = "Return : newline()"; XtTranslations transTable; (after declarations) transTable = XtParseTranslationTable(newTrans); (after creating but BEFORE managing text widget) XtOverrideTranslations(textWidget, transTable); Since I am using UIL to specify my widgets, I had to modify the creationCallback of my text widget to set a global variable so that I could access it again from within the application code to override its translations. Again, many thanks. annette myjak arm@sps.com