[R] Tktable disable cell

James Wettenhall wettenhall at wehi.edu.au
Tue Jul 29 02:52:28 CEST 2003


Thomas Sudler <TSudler at ch.imshealth.com> wrote:
> Is it possible to "block" a cell (I mean, that you can't make 
an entry)?
> How can I program this? And how can I deactivate a cell when 
the cell is
> activated? (command?)

Thomas,

Try this.  (Note that pasting in Tcl commands to set arrays is 
not very nice.  See my email reply to your question about changing 
cell values.)

Regards,
James

require(tcltk)
tclRequire("Tktable")
tt <- tktoplevel()
table1 <- tkwidget(tt,"table",bg="white")
tkpack(table1)
tkcmd(.Tk.ID(table1),"tag","celltag","ZeroOne","0,1")
tkcmd(.Tk.ID(table1),"tag","celltag","ZeroTwo","0,2")
tkcmd(.Tk.ID(table1),"tag","configure","ZeroOne",state="disabled",bg="gray")
tkcmd(.Tk.ID(table1),"tag","configure","ZeroTwo",state="normal",bg="white")

.Tcl("set tclarray(0,0) Normal")
.Tcl("set tclarray(0,1) Disabled")
.Tcl("set tclarray(0,2) Normal")
tkconfigure(table1,variable="tclarray")




More information about the R-help mailing list