asGtkDevice {gtkDevice}R Documentation

Use Gtk drawing area widget as new R graphics device

Description

This allows one to create a new R Gtk graphics device that draws on the specified Gtk drawing area widget. The widget can be created separately from the device and hence embedded within an arbitrary graphical interface.

Usage

asGtkDevice(widget, width=300, height=300, pointsize=12)

Arguments

widget an object of class GtkDrawingArea typically created using the gtkDrawingArea function in the http://www.omegahat.org/RGtk package. This should have a simple structure, being an external pointer object containing the address of the GtkWidget and having a class vector attribute containing "GtkDrawingArea".
width a value giving a `hint' for the number of pixels in the horizontal dimension. The device will typically determine this when it first draws on the widget. Note this is in pixels, not inches as with the gtk device.
height a value giving a `hint' for the number of pixels in the vertical dimension. The device will typically determine this when it first draws on the widget.
pointsize the default pointsize to be used.

Details

Value

Currently, a logical value indicating whether the creation of the new device was successful or not.

Note

It may be possible to compile this on Windows in the near future.

Author(s)

Duncan Temple Lang

References

http://www.gtk.org, http://www.omegahat.org/RGtk http://www.omegahat.org/gtk

See Also

gtk gtkDrawingArea x11

Examples

## Not run: 
 library(RGtk)
 win <- gtkWindow(show=FALSE)
 d <- gtkDrawingArea()
 asGtkDevice(d)
 win$Add(d)
 plot(rnorm(100))
## End(Not run)

[Package gtkDevice version 1.9-4 Index]