Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hp-pcd!hpcvlx!whitty From: whitty@hpcvlx.cv.hp.com (Joe Whitty) Newsgroups: comp.windows.x.motif Subject: Re: autoscrolling in Text widget - how? Message-ID: <110630016@hpcvlx.cv.hp.com> Date: 16 Oct 90 22:04:46 GMT References: <590@synopsys.COM> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 45 > / hpcvlx:comp.windows.x.motif / kennedy@synopsys.com (Sai Kennedy Vedantam) / 3:39 pm Oct 9, 1990 / > Background: Motif 1.0.3, Text widget > > I recently moved from using Athena widgets to Motif and am currently > converting my application to use Motif widget set. I basically need to > display dynamic text (among other things) and each time new text is > entered from below, the window should automatically scroll so that the last > line is visible. It was easy to do using Athena text widget because it was > taken care of by the text widget automatically. I can not seem able to > do it with the Motif Text widget try as I might! The widget always displays > the top n lines and NOT the bottom n lines. > Since the text I will be displaying might contain hundreds of lines, I need > an efficient solution for this. > Now, the question is: > > >>> Is it a bug? If so, is there a patch/fix available? > ( we do have source license for Motif) No this is not a bug. There are two solutions I will offer: 1. If you have the resource XmNautoShowCursorPosition set to True (the default) then you should be able to use the function XmTextSetInsertionPosition() (XmTextSetCursorPosition in Motif 1.1) to do auto scrolling for you. Do that as follows: XmTextSetInsertionPosition(widget, XmTextGetLastPosition(widget)); 2. As an alternation solution you could use XmTextShowPosition(). Note: If XmNautoShowCursorPosition is set to 'True', by using XmTextShowPosition(), the cursor will still remain in it's old location. Actions that move the cursor will scroll the text back to the location of the cursor. XmTextShowPosition(widget, XmTextGetLastPosition(widget)); There are several functions in Motif 1.0 that have become documented in Motif 1.1. XmTextGetLastPosition() was hidden in Motif 1.0 but is now public in Motif 1.1. > -Sai Vedantam > kennedy@synopsys.com > ...sun!synopsys!kennedy > Ph:415-962-5467 ---------- Joe Whitty