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

Re: list widget



Stuart Robertson (zeraph@my-deja.com) writes:

> Wow, you guys are getting a bit philosophical here.  

They are showing off. It is the kind of posturing and
thumping the chest that always goes on in the lead-up
to elections in the IDL Expert Programmers Association
meeting in October. Don't pay any attention to it.
It (and the national elections, which have been going
on now for, what, 10 years?) will be over soon.

> 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?

Oh, you thought "multiple" meant you might get...
No, that would be *way* too easy. No programming
involved there. Not a programmer's solution at all. :-)

In fact, "multiple" only changes what the list widget will 
*look* like, it doesn't change the way it works one iota.
Every time you make a selection you get an event in your
event handler. If you want to keep track of them all,
you will have to figure out a way to do that. This makes
these list widgets harder to work with than you ever
thought possible.

In practice, you almost always have to incorporate them
into some kind of compound widget, with more buttons so
you can figure out what you are suppose to *do* with the
list items. :-(

In fact, this may be just the example I was kicking 
around for this morning to show off what a wonder
compound widgets written as objects are. I'm in the
middle of something else at the moment, but check
back later this week. I might have something for you. :-)

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155