How to add widgets of gWidgets to widgets of rgtk2 ???

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add widgets of gWidgets to widgets of rgtk2 ???

Crish..
I have a layout in  gwidgets. To this, I wanted to add a Textbox(gtkEntry) created from rgtk2...

The code is as follows:

MainLayOut <- glayout(homogeneous = FALSE, spacing = 10, container = SubGroup)
MainLayOut[1, 1, anchor=left] <- "Number of Total Patients: "
font(MainLayOut[1, 1, anchor=left]) <- c(weight="bold")
patients <- gtkEntry()
patients['text'] <- "200"
patients['xalign'] <- 1
MainLayOut[1, 2, anchor=Right ]$add(patients) # <- gedit("200", container=MainLayOut)

Error: Error in MainLayOut[1, 2, anchor = Right]$add :
  $ operator is invalid for atomic vectors

please provide me a solution

Thanking you
Krishna
Reply | Threaded
Open this post in threaded view
|

Re: How to add widgets of gWidgets to widgets of rgtk2 ???

jverzaniNWBKZ
For this it would be best to insert an intermediate group container, as its add method allows you to add the RGtk2 widgets. Something like:

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

w <- gwindow()
lyt <- glayout(cont=w)
lyt[1,1] <- (g <- ggroup(cont=lyt))

widget <- gtkButton("click me")
add(g, widget)


Otherwise you can get the underlying GtkTable widget with: getToolkitWidget(lyt)
Reply | Threaded
Open this post in threaded view
|

Re: How to add widgets of gWidgets to widgets of rgtk2 ???

Crish..
This post has NOT been accepted by the mailing list yet.
Thank you Verzani....