comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: HELP with IDL widget_text values
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: HELP with IDL widget_text values [message #537] Tue, 01 September 1992 08:37
benell is currently offline  benell
Messages: 7
Registered: September 1992
Junior Member
In article <87523@netnews.upenn.edu> mark@ginger.biophys.upenn.edu (Mark Elliott) writes:
>
> I have an IDL text widget (scrollable) which has lines appended to it
> during the course of a program. The line I use looks like:
>
> WIDGET_CONTROL, TXTWID, SET_VALUE = LINES, /APPEND
>
> The problem is that as the newly added lines of text are added,
> the widget's scroll window is not adjusted to make the new lines visible.
> Consequently, the user has no idea that new text is there. Is there any way
> to keep the text widget's view window on the bottom most line?
>

About the easiest way to do this is to "set" the value of the text
widget to its old value with the new line added to the bottom. Idl will
then "recompute" the size of the scroll bar. This would be done as follows:

WIDGET_CONTROL, TXTWIN, GET_VALUE = BUFFER ;Get the current text values

BUFFER = [BUFFER, LINES] ;Append the new lines to the value array.

WIDGET_CONTROL, TXTWIN, SET_VALUE = BUFFER ;Set text with values

This should do the trick. -K
Re: HELP with IDL widget_text values [message #538 is a reply to message #537] Mon, 31 August 1992 20:43 Go to previous message
strebel is currently offline  strebel
Messages: 3
Registered: September 1992
Junior Member
In article <87523@netnews.upenn.edu> mark@ginger.biophys.upenn.edu (Mark Elliott) writes:
>
> I have an IDL text widget (scrollable) which has lines appended to it
> during the course of a program. The line I use looks like:
>
> WIDGET_CONTROL, TXTWID, SET_VALUE = LINES, /APPEND
>
> The problem is that as the newly added lines of text are added,
> the widget's scroll window is not adjusted to make the new lines visible.
> Consequently, the user has no idea that new text is there. Is there any way
> to keep the text widget's view window on the bottom most line?
>
There is no automatic way to do it, but it can be done manually by setting
the scrollbar position. The window is only adjusted when it is redrawn, so
you may have problems if the text line you add is wider then the original
lines. You could just redraw the widget (bad solution!).
hope this helps

-stephen s
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: HELP with IDL widget_text values
Next Topic: PC-IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:30:06 PDT 2025

Total time taken to generate the page: 1.04046 seconds