Re: [R] tcl/tk bind destroy event

From: Franco Mendolia <franco.mendolia_at_gmx.de>
Date: Thu 03 Aug 2006 - 22:25:03 EST

> I don't think that is it. As I read it, Tk catches the Destroy event
> alright, but the problem is that it is too late: the window
> destruction is already in motion at the time and there's no way to
> "undestroy" it from within binding. I think you need to create a "wm
> protocol" handler for WM_DELETE_WINDOW. As in
>
> x <- tktoplevel()
> tcl("wm", "protocol", x, "WM_DELETE_WINDOW", quote(cat("I'm staying!\n")))
>
> --- now try to destroy the window using window controls ---
>
> tcl("wm", "protocol", x, "WM_DELETE_WINDOW", "")
>
> --- things should be back to normal now ---

Yeah! That's it! Thanks!



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Aug 03 22:33:45 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 04 Aug 2006 - 00:17:38 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.