kgb@genrad.com (Kathy J. Grant) (02/22/91)
I'm writing to a scrolling text widget inside a scrolled window and would like to keep the last lines written visible. I saw the recent FAQ question asking just this question: >>Subject: 11) When I add text to a scrolling text widget how can I get the new >>text to show? >> >>Answer: Use the call undocumented in Motif 1.0 >> >> void XmTextShowPosition(w, position) >> Widget w; >> XmTextPosition position; >> >>where position is the number of characters from the beginning of the buffer >>of the text to be displayed. If you don't know how many characters are in the >>buffer, use another call undocumented in Motif 1.0 >> >> position = XmTextGetLastPosition(w) But this does not work for me. I still get the first lines of text made visible. I poked around inside the Motif code (TextIn.c) where I saw: XmTextShowPosition((Widget)tw, (XmTextPosition) -1); Does -1 mean 1 character from the end of file? Whatever it means, it didn't work for me. I also tried using XmTextSetInsertionPosition() in combination with the autoShowCursorPosition, which suggests it'll give me what I want. Again, no dice. Wanting the last text seems like such a basic need that I'm surprised that it's not handled easily, preferably by some policy setting. Is there something I'm missing? I'm running on a sparc with X11R4, Motif 1.1.1, and SunOs 4.1. Thanks for any help. Please send email rather than posting. Kathy Grant kgb@genrad.com