The stable version of RGtk2 requires GTK version 2.8.0 or higher (and its dependencies). If you're on Linux, you probably already have GTK installed, though it might not be the latest version. There are GTK packages available for Mac OS X. If you're on Windows, download (exe, 6 meg) the automatic installer for the GTK runtime. If you want to access Libglade you'll need it installed as well (Libglade is included in the Windows runtime).
The latest stable RGtk2 package is available on CRAN. If you want to embed R graphics into your GUI, you need the cairoDevice package (also available on CRAN).
To get started, load the library and then execute a demo. For example:
> library(RGtk2) > demo(appWindow) > demo(package="RGtk2") # to see the rest
To draw R graphics inside an RGtk2 GUI:
> win = gtkWindow() > da = gtkDrawingArea() > win$add(da) > asCairoDevice(da) > plot(1:10)
RGtk2 2.10.5: Development version of RGtk2 that binds to GTK+ 2.10.x and supports extending GObject classes from R. Use
install.packages("RGtk2", repos="http://www.ggobi.org/r") to try it, but beware - it is a beta development release.
cairoDevice 1.2: Many bug fixes, support for
RGtk2 2.8.7: Minor bugfix release, if I remember correctly.
demo(appWindow) on Linux:
demo(appWindow) on Windows:
The nature of the R event loop prevents the continuous execution of the GTK main loop, thus preventing things like timers and idle tasks from executing reliably. This manifests itself when using functionality such as
Please report bugs to Michael Lawrence (user lawremi at the domain iastate.edu). Thanks.