jerry83
2009-Nov-28 22:34 UTC
[R] how to put ggobi display into a GUI window setup by gWidgets
Hi, I want to put a ggobi display into a GUI window setup by gWidgets, but error occur said it is not a S4 object. Does anyone have any idea about how to put it in or maybe it can not be put into a widget at all? Thanks A LOT! -- View this message in context: http://n4.nabble.com/how-to-put-ggobi-display-into-a-GUI-window-setup-by-gWidgets-tp930529p930529.html Sent from the R help mailing list archive at Nabble.com.
j verzani
2009-Nov-29 21:12 UTC
[R] how to put ggobi display into a GUI window setup by gWidgets
jerry83 <chaohan1983 <at> yahoo.com> writes:> > > Hi, > > I want to put a ggobi display into a GUI window setup by gWidgets, but error > occur said it is not a S4 object. > > Does anyone have any idea about how to put it in or maybe it can not be put > into a widget at all? > > Thanks A LOT!To embed a GTK widget into gWidgets isn't too hard, just call the add method. I'm not sure how to get the GTK object you want from the ggobi interface. Below is an example that you might be able to modify: ## library(RGtk2) library(rggobi) library(gWidgets) options(guiToolkit="RGtk2") ## ggoobi object x <- ggobi(mtcars) ## grab child from main window. Modify (how?) to get ## other widgets toplevel <- ggobi_gtk_main_window(x) child <- toplevel[[1]] # toplevel has only one child toplevel$remove(child) # remove child if keeping toplevel toplevel$destroy() # or destroy if not ## add to a gWidget instance using gWidgetsRGtk2: w <- gwindow("A gwidget's window") g <- ggroup(cont = w, expand=TRUE) add(g, child, expand=TRUE) --John