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

Home » Public Forums » archive » How to cleanup an object with a non-modal widget method
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: How to cleanup an object with a non-modal widget method [message #88068 is a reply to message #88066] Mon, 17 March 2014 15:15 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
wlandsman writes:

> I have an object with a non-modal widget display method. While it is usually used in communication with other objects, I also want to have a simple wrapper to display the widget.
>
> pro displaymap
>
> oAstroMap = obj_new('AstroMap') ;Create the object
> oAstroMap.widgetdisplay ;Create the display widget
>
> return
> end
>
> While this works, it doesn't clean up after itself, leaving the heap area full. I can't put an OBJ_DESTROY statement before the RETURN because the non-modal widget doesn't wait for the widget to be destroyed, and executes the OBJ_DESTROY right away.
>
> I suppose what I want is for the widget to destroy the underlying object when one presses the Quit button. But my experiments with "OBJ_DESTROY, self " have not been successful.

I would write DisplayMap in such a way that you can get the object
reference back from it (write it as a function, or return the object in
a keyword). Then, I would just make sure I added the object reference to
the info structure of the widget program that calls it, and destroy
along with the other pointers and objects I was cleaning up in the
widget cleanup routine.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HOW TO COMPUTE BOUNDARY VALUES WHEN YOU HAVE TWO SPIKES IN YOUR DATA
Next Topic: IDL's BESELJ returns NAN for small argument and large order

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

Current Time: Wed Oct 08 19:32:41 PDT 2025

Total time taken to generate the page: 0.00356 seconds