Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Help with Athena Widgets using Text Widgets Message-ID: <8912282029.AA22159@expo.lcs.mit.edu> Date: 28 Dec 89 20:29:20 GMT References: <1291@kuling.UUCP> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 33 > I want to have one text window open for error messages etc to > appear in as they come. One sort of dump window for various text > messages. I have seen several examples of using text widgets, but > all was just using predefined static strings or from file. I want > to know how to do to have different strings (texts) to appear in > the text widget. How do the X Window system know when to update > the screen when I have copied the new text into the assigned string. The easiest way to modify the text in a pre-R4 Athena Text widget is to use the convience function XtTextReplace(). The function will take a section of text displayed and replace it with some new text. The new and replaced strings need not be of the same lenght, so you can also use this function to add or remove text. NOTE: This funtion will only work with text widgets that have their editType resources set to editable. If you do not want to allow the user to edit the text, just modify the Translation table to remove all functions that will allow editing. Remember that pre-R4 Athena Text widgets use the string in place, so a buffer must be allocated that is big enough to contain all the text that you want the widget to contain. For continous displays this is usually accomplished by eventually removing the text at the beginning of the buffer to make room for the new text at the end of the buffer. Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213