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

Re: Widget Event Handling Problem



Jason Brookes <jason.brookes@rmsb.u-bordeaux2.fr> writes:

>	I have been experiencing an annoying widget-event handling problem. I
>create a widget "sub-panel" on which the user is allowed to set
>(exclusively) one of four possible buttons, each button corresponding to
>a different image. I have included the relevant code from the widget
>creation and event handling functions below. The problem is that
>whenever one of the four buttons is selected, the event handling routine
>is entered twice, AS IF responding to both the previous mouse button
>release, and the current mouse button press (this may or may not be what
>is actually happening). For example, if button_3 is currently set, and
>the user sets button 1, the event handling routine will first execute
>the code corresponding to 'stim_3' in the CASE statement followed by the
>code corresponding to 'stim_1'. I would much rather it executed only the
>code corresponding to 'stim_1'.
>	Hope my explanation is clear(ish). Can anybody enlighten me ?

Exclusive buttons do indeed generate both an unselect and select
event. That is, unless, you set the /No_Release keyword on the
buttons, in which case they only generate select events.

>	While I'm at it, is there an elegant way of updating the maximum value
>for a floating-point slider ?

No, no elegant way without hacking the code.

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