On Tue, Sep 09, 2003 at 12:10:06PM -0300, [EMAIL PROTECTED] wrote:
> hello, how i cant to charge in form dynamic a checkbutton, try to do it 
> with a vector be charged automaticamente but not
> works, for example
[...]
> while (i<=j){ 
>  b[i]<-tkcheckbutton(f,text="b[i]",variable="b[i]",relief="raised")
> #how b[i] is the same "variable" all the time for checkbutton
>  tkpack(b[i])
>  i<-i+1
> }

You may want to re-read some of the available code examples. What you did is
fundamentally broken -- you do not pass strings with variables names inside.

You need to define some variables via the tclVar() function, and you can
access the values of those variables in non-tcltk expressions with tclvalue().

What you want it probably close to this -- it uses menubuttons rather than
checkbuttons but is the closest example I had hanging around here:


    color <- tclVar("blue")
    long.color <- tclVar(paste("Status is", tclvalue(color)))
    for (i in c("red", "green", "blue"))
      tkadd(m, "radio", label=i, variable=color, value=i,
            command=function(){
              cat("Background is", tclvalue(color), "\n")
              tclvalue(long.color) <- paste("Status is", tclvalue(color))
            })
                          
Hth, Dirk

-- 
Those are my principles, and if you don't like them... well, I have others.
                                                -- Groucho Marx

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to