From p.murrell at auckland.ac.nz  Fri Jul 30 05:45:47 2010
From: p.murrell at auckland.ac.nz (Paul Murrell)
Date: Fri, 30 Jul 2010 15:45:47 +1200
Subject: [Rd] HowTo get callback on destroy of grDevices::windows()
In-Reply-To: <4C4DE6AC.7050904@fh-lausitz.de>
References: <4C4DE6AC.7050904@fh-lausitz.de>
Message-ID: <4C524AEB.2060806@auckland.ac.nz>

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/



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