Re: YSIZE of widget_text [message #38028] |
Tue, 17 February 2004 06:23  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Nuno Oliveira writes:
> If have a widget text which number of lines I want to be variable, how
> do I do? If I don't define it (defining only src_ysize), idl assumes
> ysize=1 and puts an array of strings in a single line! I can set ysize
> as a number so big I never expect to need to use those lines, but is
> there other way?
Don't you want the Y size to be equal to the number
of elements in your string array?
Widget_Control, textID, YSize=N_Elements(myStrings)
You will want to almost *always* avoid setting screen
sizes. Nothing but woe ever comes from it. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: YSIZE of widget_text [message #38106 is a reply to message #38028] |
Wed, 18 February 2004 05:21  |
Nuno Oliveira
Messages: 75 Registered: October 2003
|
Member |
|
|
Thanks again, David.
My problem was that I was looking (in the quick reference) only in
widget_control keywords for widget_text. I forgot to see widget_control
keywords for ALL widgets. :(
I saw your suggestion to avoid setting screen size, but the case is that I
want to build a saving tool. And the question here is how to navigate in the
directories. So the number of strings (the files) will be different from
directory to directory and the size of the main window is constant. I'm
assuming that for what I want scrolling the widget_text is inevitable. Is
that it?
This reminds me of another question. Since I have a widget_base realized is
there a way do remove or add components (like buttons)? I think I tried once
to make an event where a button is added and then "realize" the widget_base
again but I guess it didn't work.
Cheers,
Nuno.
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.1a9bd1d9b5896ee5989691@news.frii.com...
> Don't you want the Y size to be equal to the number
> of elements in your string array?
>
> Widget_Control, textID, YSize=N_Elements(myStrings)
>
> You will want to almost *always* avoid setting screen
> sizes. Nothing but woe ever comes from it. :-(
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|