Re: [R] tcltk again

From: Charilaos Skiadas <cskiadas_at_gmail.com>
Date: Sun, 30 Dec 2007 12:19:01 -0500

On Dec 30, 2007, at 11:55 AM, Richard Müller wrote:

> Oops, I just sent the wrong mail. It should be the following one.
> Please
> delete my mail from 30.Dez. 17:51
>
>
> Sorry, but I don't really understand the recommended method using
> the tk-Box
> "tkGetSaveFile".
> I wrote the following code:
> X11()
> # some code to generate a plot on the screen omitted
>
> res <- tkmessageBox(title="Finish?",
> message="save as PDF?",
> icon="question", type="okcancel")
>
> if (tclvalue(res) == "ok")
> Datei <- tkgetSaveFile(initialdir="temp/",defaultextension=".pdf",
> initialfile="Haupt_Chl_Phaeo.pdf")
> dev.copy(pdf, tclvalue(Datei))

You need to specify the arguments using their explicit names, namely:

        dev.copy(pdf,file=tclvaue(Datei))
And that should be followed by closing the pdf device (since dev.copy leaves the device open). So I would follow that by

        dev.off()

Haris Skiadas
Department of Mathematics and Computer Science Hanover College

> else graphics.off()
> graphics.off()
>
> In the moment I'm saving I dont have the pdf generated yet. If I
> put it the
> other way round:
> dev.copy(pdf, tclvalue(Datei))
> if (tclvalue(res) == "ok")
> Datei <- tkgetSaveFile(initialdir="temp/",defaultextension=".pdf",
> initialfile="Haupt_Chl_Phaeo.pdf")
> I don't have the filename specified when it is needed.
> (But today I could finish the Windows versions at last, using
> WinDialog ;-)
>
> Greetings
> Richard
>
> --
> Richard Müller - Am Spring 9 - D-58802 Balve-Eisborn
> www.oeko-sorpe.de



R-help_at_r-project.org 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 Sun 30 Dec 2007 - 17:21:27 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 Sun 30 Dec 2007 - 18:30:21 GMT.

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