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

Re: widget_list in IDL 5.1



David Fanning wrote:
> 
> It seems I have several choices:
> 
> (1) Act on every event, which I normally don't like to do
>     at all.
> 
> (2) Guess when the user is finished, which results (believe me!)
>     in a lousy user interface.
> 
> (3) Write a compound widget with the list widget and an OK
>     button to let me know when the user *really* wants me to
>     respond to the selection event. But this is just like the
>     multiple selection widget I hacked up before the MULTIPLE
>     keyword was available.
> 
> What do some of the rest of you do? If we can get some
> kind of consensus, I'll write an article about it for my
> web page.
> 

What I do is probably a similar hack to what everyone else has to
do to get this to work. I just have an array of flags that tell me
which items are currently selected, and each time I process a 
WIDGET_LIST event I update the flags (to either select or unselect
items). In the list itself, selected items are marked with '*'.

In our applications it's always the case that the user has to
press some "Start" button or the like to act on the selected items,
so knowing when the user is finished selecting items isn't really
an issue (yet!).

I was very disappointed after I learned that the event from a
list widget only returns one item when multiple items are selected.
Duh!

Dave
-- 

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    David S. Foster         Univ. of California, San Diego
     Programmer/Analyst     Brain Image Analysis Laboratory
     foster@bial1.ucsd.edu  Department of Psychiatry
     (619) 622-5892         8950 Via La Jolla Drive, Suite 2240
                            La Jolla, CA  92037
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~