[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list widget


Try  Selected = Widget_Info(MyWidgetList, /list_Select).  Selected should
contain the indices in the selection sorted in ascending order (even if
selected from the bottom up.)

It is appealing to make the INDEX value the list selection, but then it
would have to be variable in size.  Since the returned event is a named
structure, then the index field would have to be a pointer (so it could be
pointing to a scalar, an array, etc.)    If it was a pointer, then who is
responsible for cleaning it up and when?   You don't want to walk into
that pasture without stepping with great care.

I bumped into this just recently when writing a wrapper around the list
widget; I made the event structure with two special fields, Index0 (the
first index) and SelectN (the number of selections).

Its good to wax pragmatic.


Stuart Robertson wrote:

> Wow, you guys are getting a bit philosophical here.  This is my first
> posting and OK you definitely have my respect, but could you possibly
> lower yourself to helping with questions like 'Why I don't get multiple
> element output from my list widget?' please?
> Here is my widget_definition:
> Widget_list(tlb,sensitive=1,/multiple,ysize=26,event_pro='anypro')
> So I get my array of filenames into my list widget and then try to
> select four files by left click + shift left click below (or just
> dragging the cursor) so it highlights the desired four file names and
> the event.index only gives the index of the last filename.
> Is there something obvious I'm doing/not doing or some secret IDL kung
> fu I could perform to get it to work?
> Thanks very much,
> Stu.
> (Of the DF academy of IDL programmers)
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Ben Tupper
Bigelow Laboratory for Ocean Science
West Boothbay Harbor, Maine
     note: email address new as of 25JULY2000