| Re: widget_list in IDL 5.1 [message #11932 is a reply to message #11930] |
Tue, 09 June 1998 00:00  |
J.D. Smith
Messages: 214 Registered: August 1996
|
Senior Member |
|
|
Jonathan Rogness wrote:
>
> I'm building an interface to routines that I've written over the past
> couple of years, and after we upgraded to IDL 5.1 earlier this week I
> discovered I can now use the MULTIPLE keyword to WIDGET_LIST, which
> allows users to select more than one item in the list.
>
> Here's my problem: how can I tell which items have been selected? The
> index field of the Event structure is still a single number, not an
> array. Even if many items are selected, Event.Index is just the index
> of the /first/ selected item. Do I have to call widget_control? Out of
> curiosity I tried using the get_value keyword to widget_control, but it
> looks like that's still not an option with list widgets.
>
> My apologies if this is answered in the documentation. I only have
> printed manuals through version 5.0, and our online HyperHelp is causing
> my window manager to crash. (Hopefully RSI will fix that relatively
> soon.) I can see the documentation for WIDGET_LIST, which doesn't
> answer my question, but if I try to look up WIDGET_CONTROL, I end up
> having to restart my X-Server because of the crash.
>
> Thanks for any help -
>
> Jon
Just use:
list=widget_info(list_widget,/LIST_SELECT)
This will always return the current selected , or -1 if none selected.
JD
--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-4083
206 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
|
|
|
|