Re: Widget_List question ... [message #12661 is a reply to message #12645] |
Fri, 07 August 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Darran (darran@my-dejanews.com) writes:
> By initiating Widget_List without a value field, viz.
>
> list = widget_list(base)
>
> I obtain a list box with no selectable items - fine.
> However, if I now add some elements to the listbox, it
> doesn't seem possible to get back to this "null" state.
> I've tried to get back to a null list via calls like
>
> widget_control, list, set_value=ptr_new()
> widget_control, list, set_value=strarr(0)
> widget_control, list, set_value=strarr()
>
> with no success. The following gives a selectable
> blank:
>
> widget_control, list, set_value=''
>
> Since IDL doesn't allow one to query the value of
> a widget_list, I cannot extract the initial value
> and discover its type.
It is not at all clear to me why you would WANT to
be doing this, but how about this:
Widget_Control, list, /Destroy
list = Widget_List(base)
Cheers,
David
P.S. Those of you who have heard me preach over and over
to NEVER destroy a widget sub-hierarchy will be pleased
to learn that "NEVER" means "almost NEVER". RSI assures
me that you can get away with this behavior now in almost
every case. I still cringe when I recommend it, but it
has proven useful in several examples lately. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|