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

Re: cw_fslider



davidf@dfanning.com (David Fanning) writes:

> David Fanning (davidf@dfanning.com) writes:
> 
[..........]
> 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

And what if the event_pro tries to communicate with you in the mean time?
Probably safer with

  thisEvent = { ID:parent, TOP:ev.top, HANDLER:0L, VALUE:value, DRAG:drag }

  event_pro=state.event_pro
  WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY
  IF event_pro NE "" THEN BEGIN
     Call_Procedure, event_pro, thisEvent
     thisEvent = 0
  END
  RETURN, thisEvent

-- 
--------------------------------------------------------------------------
Stein Vidar Hagfors Haugan                                    
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO

NASA Goddard Space Flight Center,      Email: shaugan@esa.nascom.nasa.gov
Mail Code 682.3, Bld. 26,  Room G-1,   Tel.:  1-301-286-9028/240-354-6066
Greenbelt, Maryland 20771, USA.	       Fax:   1-301-286-0264
--------------------------------------------------------------------------