# Define the widgets
pW1 <- list(Name="AAA", Value="bbb",
toText=function(x) paste(x,collapse= ","), fromText=NULL,
canEdit=TRUE,
buttonFun = fileBrowser, buttonText = "Browse")
pW2 <- list(Name="BBB", Value="x,y,z",
toText=function(x) paste(x, collapse=","), fromText=NULL,
canEdit=TRUE, buttonFun = ls, buttonText = "List")
pW3 <- list(Name="CCC", Value="ccc",
toText=function(x) paste(x, collapse = ","), fromText=NULL,
canEdit=TRUE, buttonFun=NULL, buttonText=NULL)
widget1 <- list(wList = list(a = pW1, b = pW2, c = pW3),
preFun = function() "Hi",
postFun = function() "Bye")
if(interactive()){
tt <- widgetRender(widget1, "try")
getWvalues(tt)
}else{
getWvalues(widget1)
}
Run the code above in your browser using DataLab