# NOT RUN {
local(envir=.PBSmodEnv,expr={
focus <- function() {
winName <- getWinVal()$select;
focusWin(winName);
mess = paste("Calling focusWin(\"", winName, "\")\n",
"getWinVal()$myvar = ", getWinVal()$myvar, "\n\n", sep="",collapse="")
cat(mess); invisible()
}
#create three windows named win1, win2, win3
#each having three radio buttons, which are used to change the focus
for(i in 1:3) {
winDesc <- c(
paste('window onclose=closeWin name=win',i,' title="Win',i,'"', sep=''),
paste('entry myvar ', i, sep=''),
'radio name=select value=win1 text="one" function=focus mode=character',
'radio name=select value=win2 text="two" function=focus mode=character',
'radio name=select value=win3 text="three" function=focus mode=character');
createWin(winDesc, astext=TRUE); };
})
# }
Run the code above in your browser using DataLab