Re: Unable to get the user value of the top level base after a draw widget expose event [message #36118 is a reply to message #36115] |
Thu, 14 August 2003 08:31  |
Pavel Romashkin
Messages: 166 Registered: April 1999
|
Senior Member |
|
|
It seems you are losing your State structure. To check, get rid of
/no_copy everywhere and try again. If it works, comb through your code
and find where do you forget to put State back in. Typically this
happens when you put your widget_control, event.top, set_uvalue = state,
/no_copy in an IF statement that gets skipped in the code.
Also, check if you don't forget to retrieve it in the pro in question.
It should work just fine.
Good luck,
Pavel
Johan Marais wrote:
>
> I keep on getting behaviour that I do not understand and as far as I
> understand it, should not happen. I use draw widgets and objects graphics
> with the EXPOSE_EVENTS from the draw widgets enabled. Here is an example:
>
> pro image_Expose, event
> widget_control, event.top, get_uvalue = state, /no_copy
> for i=0,7 do state.combWindow[i]->Draw, state.combView[i]
> widget_control, event.top, set_uvalue = state, /no_copy
> end
>
> pro setThresOf, event
> widget_control, event.top, get_uvalue = state, /no_copy
> state.ThresOf = event.value
> widget_control, event.top, set_uvalue = state, /no_copy
> end
>
> where image_Expose the event handler for the draw widget's expose event is.
> After a call to image_expose has been made and when I try to get the user
> value of the top level base, (for example in setThresOf) I receive the
> following error message:
>
> % Expression must be a structure in this context: STATE.
>
> When I issued the help statement, I receive the following:
> IDL> help, state, /STRUCT
> STATE UNDEFINED = <Undefined>
>
> It seems to me that the program are unable to get the top levels base user
> value once an expose event was executed.
>
> Did anyone ever come across this? I do not know whether any other part of
> the program can have an influence as well.
> --
> Johan Marais
|
|
|