Re: buttons on exclusive base [message #12066 is a reply to message #12045] |
Wed, 10 June 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Cathy (csaute3@alumni.umbc.edu) writes:
> I have an exclusive base created by WIDGET_BASE(/EXCLUSIVE).
> (It can only have button children and only one button can be
> set at a time.) I use
>
> WIDGET_CONTROL, button, SET_BUTTON=1
>
> to select one button on in my main routine for my default and
> the rest of the buttons are off.
>
> Question: In my event loop, how do determine which button is
> on? Is there a keyword to WIDGET_INFO?
The selected button is identified by the ID field of the
event structure in your event handler. All the other buttons
will be de-selected automatically. If you want other parts
of the program to know the currently selected button,
you normally put a "currentButton" field in your info structure.
Your button event handler code might look something like this:
PRO Button_Events, event
Widget_Control, event.top, Get_UValue=infoPtr
(*infoPtr).currentButton = event.ID
END
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/
|
|
|