[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Widget Event Handling Problem
- Subject: Re: Widget Event Handling Problem
- From: davidf(at)dfanning.com (David Fanning)
- Date: Mon, 12 Apr 1999 07:22:28 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: Fanning Software Consulting
- References: <36EC3C62.39CE88A0@scolley.freeserve.co.uk>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:14302
Jason Brookes <email@example.com> 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.
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: firstname.lastname@example.org
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155