comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Passing info and destroying widgets...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Passing info and destroying widgets... [message #15894 is a reply to message #15879] Mon, 21 June 1999 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Robert King wrote:
>
> Hi Dirk,
>
> I think that I came across this exact same problem only yesterday! I was
> using one event handler to manage all my events including exit/quit events
> where the widget hierarchy is destroyed, i.e. something like
>
> ;----------------------------------------------
>
> Pro my_event_handler, event
> Widget_Control, event.top, GET_UVALUE=info, /NO_COPY
> Widget_Control, event.id , GET_UVALUE=button
>
> CASE button OF
> 'Open' :BEGIN
> ....
> END
> 'Save' :BEGIN
> ....
> END
> 'Quit' :BEGIN
> SET_UVALUE=info,/NO_COPY
> Widget_Control, event.top,/DESTROY
> END
> ENDCASE
> Widget_Control, event.top, SET_UVALUE=info, /NO_COPY
> END
>
> [...]


seems to me as if the problem with your routine lies in the statement
AFTER the case construct: there you make another reference to event.top
which no longer exists. What you could do is:

WIDGET_ACTIVE=1
CASE button OF
...
'Quit' :BEGIN
Widget_Control, event.top, /DESTROY
WIDGET_ACTIVE=0
END
ENDCASE

IF (WIDGET_ACTIVE) THEN $
Widget_Control, event.top, SET_UVALUE=info, /NO_COPY


It just doesn't make sense to set a UVALUE in a widget that no longer
exists.

Regards,
Martin


--

|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: object suggestion for future IDL versions
Next Topic: Re: reading and plotting CDF from within IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 19:32:55 PDT 2025

Total time taken to generate the page: 0.31985 seconds