Re: [R] How to disable existing menus in tcltk?

From: talepanda <talepanda_at_gmail.com>
Date: Mon 22 Jan 2007 - 09:26:15 GMT

play below after your code and look at tk window:

tkentryconfigure(editMenu,0,state="disable") tkentryconfigure(editMenu,0,state="active")

tkentryconfigure(topMenu,1,state="disable") tkentryconfigure(topMenu,1,state="active")

HTH On 1/22/07, Jarno Tuimala <jtuimala@csc.fi> wrote:
> 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.
>



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:31:58 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.