Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Athena asciiStringWidget questions Message-ID: <8910262127.AA20276@expo.lcs.mit.edu> Date: 26 Oct 89 21:27:39 GMT References: <8909252128.AA28066@mbunix.mitre.org> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 32 > I'd like prevent a user from > typing into just any text widget (ie talking in some else's window). Smash all the editing translations for the text widget that is to be read only (Use *Text.Translations: #replace ...). Also use SetKeyboard focus so that all editing commands go to the other text widget. The function XtSetKeyboardFocus(form, edit_text) should do the trick. > Now, for a more mundane question: How do I allow more text to be saved > in an asciiStringWidget...Should I just allocate a big bunch of memory and > create my own string source? In R3 this is about it, don't forget to pass the allocacted size of the buffer to the text widget at XtNlength. > Also, I'd like the widget to just forget about > text further back than N characters, instead of beeping at me. A sliding text > window of sorts. Is that possible? (As an aside, DEC's S TEXT WIDGET allows > for a string 2^31 - 1 characters long. How do they do that?) You can do this, but you will have to do the work, when you get close you will have to delete the first N characters of the buffer, and add in the new N characters at the end of the buffer, use XtTextReplace(). Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213