Re: HELP with IDL widget_text values [message #537] |
Tue, 01 September 1992 08:37 |
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  |
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
|
|
|