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

Home » Public Forums » archive » Re: Widget_List question ...
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: Widget_List question ... [message #12645] Mon, 10 August 1998 00:00
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
David Fanning wrote:
>
> 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. :-)
>

I presume the reason he wants to return to the original state is that
all of the list elements have been removed. Imagine that a list of
items get added to the widget. They are then removed. Perhaps they
were put there by accident in the first place. In any case, our list is
now empty, but to reflect that in the widget all we can do is put a
selectable blank.

Does the destroy/rebuild method cause noticeable flashing as the widgets
are changed? Does sizing/placement get reevaluated, or does the widget
just occupy the position of the dead widget it is replacing?

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
Re: Widget_List question ... [message #12661 is a reply to message #12645] Fri, 07 August 1998 00:00 Go to previous message
davidf is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Reverse axis,
Next Topic: Re: combining object and direct graphics

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

Current Time: Wed Oct 08 19:42:11 PDT 2025

Total time taken to generate the page: 0.00564 seconds