I sometimes have a dropdown box with only one item to choose from, but this item might be a string with spaces. How can I do this in R? Here is the problem:
library(tcltk2)
root<-tktoplevel()
v <- tclVar()
d <- tk2combobox(root, textvariable=v)
tkpack(d)
# works
tkconfigure(d, values=c("a string with spaces", "a second string"))
# inserts four items instead of one
tkconfigure(d, values=c("a string with spaces"))
Any hint appreciated!
Try this:
An alternative is also available that actually puts the string in the drop-down which the above does not:
This is hinted at, although not actually illustrated, in the help page for TclInterface.