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

Home » Public Forums » archive » Re: Scrolling text
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: Scrolling text [message #18287] Fri, 17 December 1999 00:00
Peter Mason is currently offline  Peter Mason
Messages: 145
Registered: June 1996
Senior Member
Kelly Dean <krdean@lamar.colostate.edu> wrote:
> ... I now how to read the text file and parse out the Fort
> Collins forecast with IDL, but how would I get the text to slowly
> scroll through the forecast in a text widget?

This might look better if done with a graphics window, but first, some
ideas about text widgets.
It's possible to set up a text widget that just grows as you send new
lines of text to it. (It's straightforward but I don't remember how
offhand - I seldom do this.) But if there's an undetermined amount of
text to be displayed then I think it would be better to create a text
widget with a fixed number of lines, and always send it a string
array. e.g., NLINES=12; Create it with YSIZE=NLINES and always send a
STRARR(NLINES) (or maybe STRARR(NLINES-1) ?!). You'd keep the string
array in your routine and populate it from the bottom - When you
wanted to display a new line of text, you'd do something like STRINGS
[0:NLINES-2]=STRINGS[1:NLINES-1] &STRINGS[NLINES-1]=NEW_STRING
&WIDGET_CONTROL,TXT_WID,SET_VAL=STRINGS.

If you used a graphics window then you could do smooth scrolling.
This would be *much* easier to read than a text widget if the updates
were coming in thick and fast.
Say the main draw widget was GY *pixels* high and GX wide, and a text
line was TY pixels high. On startup you'd need an invisible PIXMAP
window TY pixels high and GX pixels wide. When a new line of text was
ready to be displayed, you'd first XYOUTS it to the pixmap window (in a
nice font), and then update the draw widget one pixel-line at a time
with a loop I=0,TY-1 that had contents like:
1] WSET,DRAW_WIDGET_VALUE
2] DEVICE,COPY=[0,0,GX,GY-1,0,1] to scroll the draw widget up.
3] WSET,PIXMAP_WINDOW_ID
4] Use DEVICE,COPY=[0,I,GX,1,0,0,DRAW_WIDGET_VALUE] to copy the next
line from the pixmap window to the bottom of the draw widget.
5] Wait a few dozen milliseconds.
You'd have to experiment a bit to find a suitable value for TY, but
that shouldn't be hard.


Good luck
Cheers
Peter Mason
ICQ: 29778826


Sent via Deja.com http://www.deja.com/
Before you buy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Wiener deconvolution, anyone?
Next Topic: Another IDL twist

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

Current Time: Wed Oct 08 19:23:31 PDT 2025

Total time taken to generate the page: 0.00519 seconds