Re: [R] tk combobox question

From: JeeBee <JeeBee_at_troefpunt.nl>
Date: Thu 10 Aug 2006 - 07:19:25 EST

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.



R-help@stat.math.ethz.ch 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. Received on Thu Aug 10 08:56:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 10 Aug 2006 - 20:20:52 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.