[R] R tcl/tk

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Oct 23 09:35:08 CEST 2006


"Charles Annis, P.E." <Charles.Annis at statisticalengineering.com> writes:

> Friends:
> 
> I am a long-time R user, learning tcl/tk, and am tying myself in knots over
> something that should be simple.
>   
> I want to create a frame and put that frame inside the toplevel frame.
> 
> This works (i.e. it places text in col 1, and the corresponding entry box in
> column 2) and later frame.2 resides where it should in the toplevel frame.
> 
> tkgrid(tklabel(frame.2, text="FACTOR column "), tkentry(frame.2,
> textvariable=FACTOR.column.value, width=2),  sticky="e")
> 
> 
> This doesn't work because I don't know how to tell tcl that answer.button1
> belongs in frame2:
> 
> tkconfigure(answer.button1, variable=buttonValue, value="TRUE")
> 
> tkgrid(tklabel(frame.2, text="Question?    yes "), answer.button1,
> sticky="e")
>                                                   ^^^^^^^^^^^^^^^
> 
> I know this can not be as hard as I am making it.

Possibly, but there seems to be some context missing, so I can't quite
grasp what you want to do. It does look a bit suspicious that you
aren't saving the objects generated by tklabel and tkentry though.

In general, the hierarchy between widgets is defined at widget
creation time, so why is there no 

answer.button1 <- tkbutton(frame.2,..whatever..) 

?
-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list