# NOT RUN {
flavors <- c("vanilla", "chocolate", "strawberry")
f <- function(h,...) print(
paste("Yum",
paste(svalue(h$obj),collapse=" and "),
sep = " "))
w <- gwindow("checkbox example")
gp <- ggroup(container=w)
glabel("Favorite flavors:",container=gp)
cbg <- gcheckboxgroup(flavors, container=gp, handler=f)
svalue(cbg) <- c(TRUE, FALSE, TRUE)
svalue(cbg)
svalue(cbg) <- "vanilla"
svalue(cbg, index=TRUE) <- 1:2
cbg[3] <- "raspberry"
## use a table to display (toolkit specific) so that scrollars can be used
cbg <- gcheckboxgroup(letters, container=gwindow(), use.table=TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab