Re: [R] changing the drawing context using Cairo and RGtk2

2012-03-08 Thread Michael Lawrence
On Wed, Mar 7, 2012 at 1:47 PM, Mark Heckmann wrote: > Michael, thanks for your answer! > > The attribute solution has its problems though. > First, how it will work: > > foo <- function(){ > w <- gtkWindow() > da <- gtkDrawingArea() > w$add(da) > asCairoDevice(da) > print(dev.cur()) >

Re: [R] changing the drawing context using Cairo and RGtk2

2012-03-07 Thread Mark Heckmann
Michael, thanks for your answer! The attribute solution has its problems though. First, how it will work: foo <- function(){ w <- gtkWindow() da <- gtkDrawingArea() w$add(da) asCairoDevice(da) print(dev.cur()) gObjectSetData(da, "dev.number", data = dev.cur()) dev.set(gObjectGetD

Re: [R] changing the drawing context using Cairo and RGtk2

2012-03-06 Thread Michael Lawrence
Currently, the GtkDrawingArea object has no real knowledge that it is being used as a graphics device. You could do something like: stick the device ID on da1/da2 as an attribute, and then have a function that does dev.set with that attribute. Michael On Mon, Mar 5, 2012 at 1:14 PM, Mark Heckmann

[R] changing the drawing context using Cairo and RGtk2

2012-03-05 Thread Mark Heckmann
I am not too familiar with Cairo and RGtk2 and have the following problem: I have a container with two GTK drawing areas converted into Cairo devices. I know that I can set the current drawing context e.g. using dev.set(). But this is tedious. How can I set the context using the objects da1 or da2