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

Re: cw_fslider



David Fanning (davidf@dfanning.com) writes:

> Then, find these two lines at the bottom of the event handler:
> 
>   WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY
>   RETURN, { ID:parent, TOP:ev.top, HANDLER:0L, VALUE:value, DRAG:drag }
> 
> Modify these two line to these:
> 
>    thisEvent = { ID:parent, TOP:ev.top, HANDLER:0L, VALUE:value, DRAG:drag }
>    IF state.event_pro NE "" THEN BEGIN
>       Call_Procedure, state.event_pro, thisEvent
>       thisEvent = 0
>    ENDIF
>    RETURN, thisEvent

Whoops! Of course, you have to put the state structure back. The code
should really look like this:

    thisEvent = { ID:parent, TOP:ev.top, HANDLER:0L, VALUE:value, DRAG:drag }
    IF state.event_pro NE "" THEN BEGIN
       Call_Procedure, state.event_pro, thisEvent
       thisEvent = 0
    ENDIF
    WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY
    RETURN, thisEvent

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