I spoke with John Verzani, the creator of gWidgets * packages, and the answer is incredibly simple (although not entirely intuitive). You access the contents of list type widgets using widget_name[] .
library(gWidgets) library(gWidgetstcltk) get_list_content <- function() ls(envir = globalenv()) # or whatever win <- gwindow() grp <- ggroup(container = win) ddl <- gdroplist(get_list_content(), container = grp) refresh <- gimage("refresh", dirname = "stock", container = grp, handler = function(h, ...) ddl[] <- get_list_content() )
Note that there are some limitations: switch lists must remain the same length.
win <- gwindow() rb <- gradio(1:10, cont = win) rb[] <- 2:11
Richie cotton
source share