Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!decwrl!ucbvax!Inference.Com!dfc From: dfc@Inference.Com (Deborah Catalano) Newsgroups: comp.windows.x.motif Subject: autoscrolling in Text widget - how? Message-ID: <9010102336.AA03454@Quaestor.inference> Date: 10 Oct 90 23:36:05 GMT References: <590@synopsys.COM> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 32 >The widget always displays >the top n lines and NOT the bottom n lines. We had the same problem and finally found the solution. There is an undocumented function: XmTextScroll(widget, num_lines) in Motif 1.0. We count the number of carriage-returns and compare the count to the number of rows in the text widget (obtained using XtGetValues). Here's a segment from our code: XtSetArg(arg[0], XmNrows, &rows); XtGetValues(text_widget, arg, 1); ... if (ch == '\n') { bottom_line++; if (bottom_line > rows) { XmTextScroll(text_widget, 1); } } I read about this function in Doug Young's book, "The X Window System -- Programming and Applications with Xt -- OSF/Motif Edition" Hope this helps! ----------------------------------------------------------------------------- Debbie Catalano Inference Corporation catalano@inference.com 213-322-5004 x194 -----------------------------------------------------------------------------