[R] Tcl Tk table

thsudler@swissonline.ch thsudler at swissonline.ch
Fri Apr 23 18:30:18 CEST 2004


Hi

Yes, I'm sure. I allready installed this additional package. The command

tclRequire("Tktable")

doesn't cause an error. So I've the Tktable package. But the command with "list" doesn't works:

tkcmd(.Tk.ID(table1),"tag","celltag","gruen",list(c("3,3", "4,4", "5,5", "6,6", "7,7", "8,8")))
tkcmd(.Tk.ID(table1),"tag","configure","gruen",bg="green",fg="green")

Error message:
Error in switch(storage.mode(x), character = .External("RTcl_ObjFromCharVector",  :  Cannot handle object of mode  list

Do you know why this could be?

Thomas

----- Original Message ----- 
From: "Peter Wolf" <s-plus at wiwi.uni-bielefeld.de>
To: <thsudler at swissonline.ch>; <r-help at stat.math.ethz.ch>
Sent: Friday, April 23, 2004 5:50 PM
Subject: Re: [R] Tcl Tk table


> thsudler at swissonline.ch wrote:
> 
> >Hi 
> >
> >I've a problem with the following example:
> >
> >library(tcltk)
> >.Tcl("array unset tclArray")
> >
> >myRarray <- matrix(1:1000, ncol=20)
> >
> >for (i in (0:49))
> >  for (j in (0:19))
> >     .Tcl(paste("set tclArray(",i,",",j,") ",myRarray[i+1,j+1],sep=""))
> >     
> >tt<-tktoplevel()
> >
> >table1 <- tkwidget(tt,"table",variable="tclArray", rows="50", cols="50")
> >
> >tkpack(table1)
> >
> >#Old version which worked in R 1.6 but it doesn't work with R 1.9 (and also not with 1.8), why??
> >.....
> >Under R version 1.6 I had no problem. Now I installed R 1.9 (with ActiveTcl) and my program doesn't work. ...
> >Thomas
> >
> >______________________________________________
> >R-help at stat.math.ethz.ch mailing list
> >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> >  
> >
> Are you sure?
> 
>  > library(tcltk)
>  > .Tcl("array unset tclArray")
> <Tcl>
>  >
>  > myRarray <- matrix(1:1000, ncol=20)
>  >
>  > for (i in (0:49))
> +   for (j in (0:19))
> +      .Tcl(paste("set tclArray(",i,",",j,") ",myRarray[i+1,j+1],sep=""))
>  >
>  > tt<-tktoplevel()
>  >
>  > table1 <- tkwidget(tt,"table",variable="tclArray", rows="50", cols="50")
> Error in structure(.External("dotTcl", ..., PACKAGE = "tcltk"), class = 
> "tclObj") :
>         [tcl] invalid command name "table".
>  >
>  > version
>          _
> platform i686-pc-linux-gnu
> arch     i686
> os       linux-gnu
> system   i686, linux-gnu
> status
> major    1
> minor    6.2
> year     2003
> month    01
> day      10
> language R
> 
> the error occurs with version 1.6.2, too.
> 
> Some debugging shows: the error message comes from tcl/tk and
> you need some additional features to be allowed to use the table-widget!
> you have to include:
> 
> tclRequire("Tktable")
> 
> ... and all is ok for 1.8.1 and I also hope for 1.9.0.
> 
> see: http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/tktable.html
> 
> Peter Wolf
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list