0

I've placed a gradio object into a gtable cell. Based on a selection from another control I want to modify the nature of the gradio object and replace it in the same cell.

    tmpL <- gframe(" Locations ", container=group, columns=2, horizontal=TRUE)

    tblL <- glayout(container=tmpL,spacing=5)
    tblL[1,1] <- 'Basin';tblL[1,2] <- 'Layer';
    tblL[2,1] <- gradio(names(availBasins1),cont=tblL)
    tblL[2,2] <- gradio(names(availLayers),cont=tblL

The contents of tblL[2,1] would be modified using a different gradio object based on the results of a selection from a separate control. What's the next step?

Dr Dave
  • 453
  • 1
  • 4
  • 11
  • You want to modify the items available for selection in the gradio instance? That can be done with the [<- method. If `rb = gradio(state.name[1:3], cont=w)`, then you can do `rb[] <- state.name[4:8]`. If you want to replace the radio object with a different widget, then you can place it inside a box container then use the delete method for that box container. – jverzani Feb 13 '13 at 21:43
  • Yes - I've been able to modify a gradio - the problem I had was how to extract the gradio object from the glayout object and replace it with either a new or modified object. Is the glayout object a box container? – Dr Dave Feb 14 '13 at 12:50
  • try tbl[i,2] <- (box <- ggroup(cont=tbl)). Then you can add and delete to the box: rb1 <- gradio(state.name[1:3], cont=box); delete(box, rb1); rb2 <- gradio(state.name[3:5], cont=box) – jverzani Feb 15 '13 at 04:39

0 Answers0