I think you want something like this:
require(tcltk) || stop("Package tcltk is not available.")
version.BWidget <- tclvalue(tclRequire("BWidget"))
modify_command <- function() {
print("Hey, I'm modified...")
}
tt <- tktoplevel()
values = c("foo", "bar", "jeebee")
combo <- tkwidget(tt, "ComboBox", "-modifycmd",
modify_command, values=values)
tkgrid(combo)
> How can I get the index of the selected item in an Iwidgets combobox? Till
> now I
> am only able to get the contents of the selected combobox item.
For BWidget:
as.numeric(tclvalue(tcl(combo,"getvalue")))+1
I haven't used Iwdigets yet...
JeeBee.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.