Skip to content
Prev 202142 / 398503 Next

how to put ggobi display into a GUI window setup by gWidgets

jerry83 <chaohan1983 <at> yahoo.com> writes:

Jerry, see below:
ggobi display window to the widget
GGobiScatterplotDisplay. Do you have
Here is some code to grab the display for a new display. I don't know
how to get the initial display or even how to suppress it, but I'm
not a ggobi user at this point.

library(RGtk2)
library(rggobi)
library(gWidgets)
options(guiToolkit="RGtk2")

x <- ggobi(mtcars)
## not sure how to get the initial display,
## here we create a new display and move that
disp <- display(x[1]) ## see display.GGobiData

## find table in the display heirarchy
table <- disp[[2]]

## plot is third child (rulers are first two)
plotWidget <- table[[3]]$getWidget()
table$remove(plotWidget)
## hide window that held display. Destroy() causes errors
disp$getParent()$hide() 

## now we need to declass things so that gWidgets will 
## recognize. The S3 classes from RGtk2 that gWidgets 
## knows about are declared in package (should be 
## dynamic, but aren't)

class(plotWidget) <- class(plotWidget)[-(1:3)]

w <- gwindow("A gwidget's window")
g <- ggroup(cont = w, expand=TRUE)
add(g, plotWidget, expand=TRUE)
http://n4.nabble.com/how-to-put-ggobi-display-into-a-GUI-window-setup-by-gWidgets-tp930529p930927.html
gWidgets, click here.