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 #15883 is a reply to message #15879] Mon, 21 June 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Robert King (kingrj2@bp.com) writes:

> I eventually created a separate event handler to destroy the widgets, eg
>
> Pro kill_widgets, event
> Widget_Control, event.top,/DESTROY
> END
>
> This worked with no errors!
>
> I'd like to know if there is another way around this problem as it seems
> rather strange behavoir.

"Strange" is not the word that comes to my mind when something
works with no errors. I would think it is "strange" to destroy
the top-level base and then imagine you could stick something
in its non-existent user value. But, then, that's just me. :-)

I used to write elaborate work arounds for this problem,
sometimes using WIDGET_INFO to make sure the top-level base
is still living before I stuffed something into it:

IF WIDGET_INFO(event.top, /Valid_ID) THEN $
WIDGET_CONTROL, event.top, Set_UValue=info, /No_Copy

But now I *always* have a separate event handler for the
QUIT button that does nothing but destroy the top-level
base. As Struan notes, all your clean-up should be done
in a CLEANUP routine. Doing it anywhere else means you
are going to miss it at least half the time.

I like this object-like programming approach. It's simple,
it's elegant, and it works like a charm. :-)

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
[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: Sat Oct 11 08:43:24 PDT 2025

Total time taken to generate the page: 1.04239 seconds