[R] How to disable existing menus in tcltk?

From: Jarno Tuimala <jtuimala_at_csc.fi>
Date: Mon 22 Jan 2007 - 08:57:59 GMT


Hi!

I've constructed a small menu-driven interface to a couple of R functions using the possibilities offered by the tcltk package. When user runs some specific analyses, I would then like to disable some of the menus (or menu choises) that are not applicable after the performed analysis. I tried to modify the state of an existing menu, but it seems that neither tkconfigure nor tkentryconfigure contains the state as one of its options.

Here's a snip of the code. How could I disable, for example, the Edit data menu choise after already creating the menu (I want it to be active initially)?

gui<-tktoplevel()
topMenu<-tkmenu(gui)
tkconfigure(gui,menu=topMenu)
editMenu<-tkmenu(topMenu, tearoff=FALSE)

tkadd(editMenu, "command", label="Edit data", command=function() editData())
tkadd(editMenu, "command", label="Preferences", command=function() editPref())
tkadd(topMenu, "cascade", label="Edit", menu=editMenu)

Thanks,
Jarno Tuimala



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 Mon Jan 22 20:11:36 2007

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 Mon 22 Jan 2007 - 10:30:31 GMT.

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