Re: [Rd] HowTo get callback on destroy of grDevices::windows()

From: Paul Murrell <>
Date: Fri, 30 Jul 2010 15:45:47 +1200


On 27/07/2010 7:49 a.m., 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 (?)


> thanks
> roland
> ______________________________________________
> mailing list

Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
New Zealand
64 9 3737599 x85392

______________________________________________ mailing list
Received on Fri 30 Jul 2010 - 03:52:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 30 Jul 2010 - 10:20:29 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive