[R] tcltk: Difficulties creating menus

Dirk Eddelbuettel edd at debian.org
Thu Sep 20 00:30:19 CEST 2001

On Wed, Sep 19, 2001 at 11:44:22PM +0200, Peter Dalgaard BSA wrote:
> Dirk Eddelbuettel <edd at debian.org> writes:
> Variables need special handling. You cannot just link to an R variable

Ah, yes, I modified / extended the tkttest example, but forgot that here.

> The R interface would be closer to the Tcl:
> library(tcltk)
> tclvar$color<-"blue"
> tt <- tktoplevel()
> tkpack(mb <- tkmenubutton(tt, text="Color"))
> m <- tkmenu(mb)
> tkconfigure(mb,menu=m)
> for ( i in c("red", "blue", "green"))
>    tkadd(m, "radio", label=i, variable="color", value=i)
Excellent. I had looked at tkmenu and tkadd but not figured out the
tkconfigure piece in between. Many thanks. 

> (And I was just getting to this bit for the Rnews paper that Kurt has
> been nagging me for. Thanks...)

So there will be more documentation and examples? Even better :)

Thanks, Dirk

Three out of two people have difficulties with fractions.
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list