Re: KILL_NOTIFY Programs [message #7958] |
Wed, 29 January 1997 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Scott Koch writes:
>
> Does anybody out there have any experience using the KILL_NOTIFY keyword
> in the IDL widget_base command? I would like to use it in my IDL widget
> application, but the KILL_NOTIFY program I specify never seems to execute
> when the given base widget is destroyed.
>
> Has anybody else experienced this, or am I suffering from operator error?
Clearly operator error. When I used to use KILL_NOTIFY improperly like
this, the whole computer needed to be rebooted. :-)
David Foster correctly points out that you should definately *not*
use KILL_NOTIFY with a widget hierarchy that is being managed
by XMANAGER. The correct procedure would be to use the
CLEANUP keyword to XMANAGER to assign a clean-up routine
to the top-level base.
I didn't realize, as David points out, that the value of the KILL_NOTIFY
keyword is overwritten. I just noticed that things when quickly
downhill when I used it.
However, I *do* use KILL_NOTIFY with widget programs
that are being managed by XMANAGER. For example, I often have
detached graphics windows associated with my widget programs.
These windows often exist in their own top-level bases that
are *not* managed by XMANAGER. In other words, I just
create and realize them. I don't call XMANAGER to put their
top-level bases on the list of hierarchies being managed by
XMANAGER.
Sometimes these windows have data, pixmaps, and other things
associated them that need to be cleaned up if the window is
destroyed. I will assigne a clean-up procedure to these
windows with KILL_NOTIFY.
Hope this clarifies things a bit. The documentation is just
the slighest bit unclear about this. (What kind of smiley
face do you use to indicate irony?) :-^) ... or something.
Cheers!
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
|
|
|
Re: KILL_NOTIFY Programs [message #7960 is a reply to message #7958] |
Wed, 29 January 1997 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Scott Koch wrote:
>
> Does anybody out there have any experience using the KILL_NOTIFY keyword
> in the IDL widget_base command? I would like to use it in my IDL widget
> application, but the KILL_NOTIFY program I specify never seems to execute
> when the given base widget is destroyed.
>
> Has anybody else experienced this, or am I suffering from operator error?
>
In the IDL help, under WIDGET_BASE:
KILL_NOTIFY
Note that the procedure specified is used only if you are not using
the XMANAGER procedure to manage your widgets.
...
If you use the XMANAGER procedure to manage your widgets, the value of
this keyword is overwritten. Use the CLEANUP keyword to XMANAGER to
specify a procedure to be called when a managed widget dies.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
[ UCSD Mail Code 0949 ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
Re: KILL_NOTIFY Programs [message #7982 is a reply to message #7958] |
Tue, 28 January 1997 00:00  |
Phil Williams
Messages: 78 Registered: April 1996
|
Member |
|
|
Scott Koch wrote:
>
> Does anybody out there have any experience using the KILL_NOTIFY keyword
> in the IDL widget_base command? I would like to use it in my IDL widget
> application, but the KILL_NOTIFY program I specify never seems to execute
> when the given base widget is destroyed.
>
> Has anybody else experienced this, or am I suffering from operator error?
>
> Scott Koch
I've never used KILL_NOTIFY. I accomplish cleanup in one of two ways.
1) The kill button has it's own event handler and I do all the cleanup
there.
2) Use xmanagers cleanup keyword.
Good luck,
Phil
--
/*********************************************************** ********/
Phil Williams, Ph.D.
Research Instructor
Children's Hospital Medical Center "One man gathers what
Imaging Research Center another man spills..."
3333 Burnet Ave. -The Grateful Dead
Cincinnati, OH 45229
email: williams@irc.chmcc.org
URL: http://www.irc.chmcc.org/~williams/
/*********************************************************** ********/
|
|
|