[R-gui] tcltk problem using "in"

Charilaos Skiadas cskiadas at gmail.com
Sat Dec 22 01:38:34 CET 2007


Hello all,

	I've been struggling for the best part of the last couple of hours  
with the following simple problem. Consider the following code:

library(tcltk)
tktest <- function(parent, wdgt) {
   fr <- tkframe(parent, borderwidth=2, relief="raised")
   tkgrid(wdgt, `in`=fr)
   tmp <- tklabel(fr, text="hi")
   tmp2 <- tklabel(parent, text="there")
   tkgrid(tmp)
   tkgrid(tmp2, `in`=fr)
   fr
}
tt <- tktoplevel()
t2 <- tklabel(tt,text="a")
t3 <- tklabel(tt,text="b")
sg <- tktest(tt,t2)
t4 <- tklabel(sg,text="c")
tkgrid(t3,`in`=sg)
tkgrid(t4)
tkgrid(sg)



Now, the resulting window contains the frame sg, with room in it for  
all 5 strings a, hi, there, b, c,    BUT a and b are not showing!
So, I am wondering what I am doing wrong. The `in` call seem to work  
in one case, and fail in the other two cases, and I can't tell what  
the difference is, especially between the "there" and "b" cases. What  
I find more weird is that the space is allotted, but not used.

Any help appreciated, I am starting to lose my mind over here.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College



More information about the R-SIG-GUI mailing list