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

Home » Public Forums » archive » Re: widget_list in IDL 5.1
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 in IDL 5.1 [message #11930] Tue, 09 June 1998 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
J.D. Smith (jdsmith@astrosun.tn.cornell.edu) writes in
response to Jonathan Rogness' question about multiple
list widgets:

> Just use:
>
> list=widget_info(list_widget,/LIST_SELECT)
>
> This will always return the current selected , or -1 if none selected.

Yes, this certainly tells you which widget is selected, but
the problem I have is when to take action in a multiple list
selection, since I get an event in my event handler *every*
time a selection is made.

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.

Cheers,

David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: widget_list in IDL 5.1 [message #11932 is a reply to message #11930] Tue, 09 June 1998 00:00 Go to previous message
J.D. Smith is currently offline  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 |*|
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Upgrading from idl 3.6
Next Topic: Reading DXF files

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

Current Time: Sat Oct 11 23:30:22 PDT 2025

Total time taken to generate the page: 1.52263 seconds