I'm build with the usage of the tcltk/tcltk2 package a gui which is started with rscript.exe. At this gui the user is able to open and close plot windows. Now I'm looking for a way that a r function is called when a grDevices::windows window is closed. Is there a way to attach a callback function or so, which would be triggert if the user click at close of the grDevices::window? My workarround is to check continues the open windows with the tcl command after, but it's no good workarround. thanks roland
HowTo get callback on destroy of grDevices::windows()
2 messages · rrichte2 at fh-lausitz.de, Paul Murrell
3 days later
Hi
On 27/07/2010 7:49 a.m., rrichte2 at fh-lausitz.de wrote:
I'm build with the usage of the tcltk/tcltk2 package a gui which is started with rscript.exe. At this gui the user is able to open and close plot windows. Now I'm looking for a way that a r function is called when a grDevices::windows window is closed. Is there a way to attach a callback function or so, which would be triggert if the user click at close of the grDevices::window? My workarround is to check continues the open windows with the tcl command after, but it's no good workarround.
I don't think this is possible with standard R graphics devices. Have you taken a look at the 'tkrplot' package; if you produce a tcltk window with an R graphics device embedded, instead of opening/closing raw R graphics devices, perhaps you could gain more control over the opening/closing of the window (?) Paul
thanks roland
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/