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

Re: Widget Buttons - Radio and Checkbox control



Robert S. Mallozzi (robert.mallozzi@msfc.nasa.gov) writes:

> Unfortunately I don't think there is any way to query
> the state of exclusive or non-exclusive buttons:
> 
>     WIDGET_CONTROL, buttonID, GET_BUTTON = state
>     % Keyword GET_BUTTON not allowed in call to: WIDGET_CONTROL
>     % Execution halted at:  $MAIN$ 
> 
> You will have to store the current state and drag it
> around in your program :-(

Ah, another perfect opportunity to write an object
compound widget. This is *exactly* why I wrote
FSC_DROPLIST. I was tired of not being able to get
the "value" of the droplist directly from the 
droplist itself. Plus, I wanted to be able to
set the "selection" by the name or value of the
selection, rather than always having to translate
things through the "index" of the darn thing. 

I think of object compound widgets as widgets the
way they *should* have been written. :-)

You can find FSC_DROPLIST here, if you want a model:

   http://www.dfanning.com/programs/fsc_droplist.pro

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