[R] RGtk2: How to overlay a gtkDrawingArea with a button or any other widget?

Mark Heckmann mark.heckmann at gmx.de
Thu Dec 22 01:31:13 CET 2011


I try to overlay a plot inside a gtkDrawingArea with a button (or any other widget).
I tried to put both into a gtkFixed container.
But this does not work, no printing occurs.
Does someone know a solution?

What I tried:

w <- gtkWindow()
w$setSizeRequest(400,400)
fx <- gtkFixed()
da <- gtkDrawingArea()  
fx$put(da, 100, 100) 
asCairoDevice(da)  
par(mar=c(0,0,0,0))
plot(1:10)  
btn.1 <- gtkButton("button")
fx$put(btn.1, 200, 200)   
w$add(fx) 

Thanks
Mark

––––––––––––––––––––––––––––––––––––
Mark Heckmann
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com



More information about the R-help mailing list