widget destruction [message #18959] |
Tue, 15 February 2000 00:00 |
Steven Chetelat (CS)
Messages: 11 Registered: February 2000
|
Junior Member |
|
|
I just spent a while tracing down a rotten little bug in my program,
because I had no idea that IDL would behave as it did. The code segment
was:
widget_control,ev.handler,get_uvalue=dataim,/NO_COPY
str=dataim.imname
imint=fix(strmid(str,2,strlen(str)-2))-1
imarr(imint).in_use=0 ; free the image for manipulation
widget_control, ev.handler, /DESTROY
which generated :
% XMANAGER: Caught unexpected error from client application. Message
follows... % Expression must be a structure in this context: DATAIM.
As a fix, I've added the following line immediately before the destroy
command:
widget_control,ev.handler,set_uvalue=dataim,/NO_COPY
My question is *why* does the uvalue need to be defined in order to
destroy the widget? I checked every line of code leading up to that one
(through a couple of programs) because I just didn't consider it...
K-Bye,
STEVE! (chetelat@csee.usf.edu)(steve@moffitt.usf.edu)
|
|
|