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 #88077 is a reply to message #88073] Tue, 18 March 2014 20:03 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
wlandsman writes:

>
> Mathew, David -- thanks for the suggestions. Sorry if this post appears twice -- Google groups is driving me crazy.
>
> On Monday, March 17, 2014 6:02:00 PM UTC-4, Matthew Argall wrote:
>> A simple solution would be to turn "displaymap" into a function so that you can return your oAstroMap object reference. Then, when you are done with it, you can destroy it.
>
> I am trying to write a wrapper for non-IDL users. I want them to be able to type "displaymap" at the IDL prompt and view and manipulate the widget, without them needing to perform any additional cleanup after they click the widget QUIT button.
>>
>> Maybe more to what you are looking for, check out the TLB_KILL_REQUEST_EVENTS and KILL_NOTIFY keyword to the Widget_Base function. You can have the callback routines kill the object when the top level base is destroyed.
>
> I'll look more closely at these but it still looks like the object has to destroy itself (and not just the widget), and I haven't had much luck with OBJ_DESTROY, self. Perhaps I need to also write the wrapper as an object.
>>
>> I have another, more complicated solution if neither of these work for you... Is AstroMap object based on function/object graphics? Or is it made from the old widgets?
>
> No, it uses "classic" widgets with Coyote graphics. --Wayne

I guess I still don't understand the problem. The object is created in
association with a widget program, right? The widget program can
(probably does) have a CLEANUP routine that is called when the widget
dies. All you have to do is find a way to put the object reference into
the info structure of the widget. Then, when the widget dies, you get
the info structure, find the object reference, and destroy that. There
is no "self" there. Just the object reference in a widget CLEANUP
routine. I can't imagine how this could cause problems.

PRO Widget_Cleanup, tlb
Widget_Control, tlb, Get_UValue=info
Obj_Destroy, info.objectRef
END

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 17:34:13 PDT 2025

Total time taken to generate the page: 0.00365 seconds