'\"
.so man.macros
.TH OnDestroy n "" Tk "Perl/Tk Constructs"
.SH "NAME"
OnDestroy \- Arrange for callback when widget is destroyed.
.SH "SYNOPSIS"
\fI$widget->\fR\fBOnDestroy\fR(\fIcallback\fR);

.SH "DESCRIPTION"
OnDestroy accepts a standard perl/Tk \fIcallback\fR.
When the window associated with \fI$widget\fR is destroyed then 
the callback is invoked. Unlike \fI$widget->\fR('<Destroy>',...)
the widgets methods are still available when \fIcallback\fR is executed,
so (for example) a \fBText\fR widget can save its contents to a file.
.PP
OnDestroy was required for new \fBafter\fR mechanism.

.SH "SEE ALSO"
destroy
callbacks
after
bind

.SH KEYWORDS
destroy

