[R] tcltk - command=function()

John Zhang jzhang at jimmy.harvard.edu
Thu Sep 26 23:08:00 CEST 2002


>Date: Thu, 26 Sep 2002 21:24:43 +0200
>MIME-Version: 1.0
>From: <chr.schulz at email.de>
>To: r-help at stat.math.ethz.ch
>Subject: [R] tcltk  - command=function()
>Content-Transfer-Encoding: 7bit
>
>hi,
>
>just having the idea create a simple
>tcl/tk gui-dialog for different data-file formats
>i get starting problems and it would be nice
>get some tips/tricks from experienced tcl/tk user in R !


Is this what you want?

anyName <- NULL
getFile <- function(){
    anyName <<- tkcmd("tk_getOpenFile")
}
tt <- tktoplevel()
label.widget  <- tklabel(tt,text="Decision Tree GUI")
button.widget <- tkbutton(tt,text="Select SPSSFile", command = getFile)
tkpack(label.widget,button.widget)

anyName will get what you selected from the tk_getOpenFile


>
>tt <- tktoplevel()
>label.widget  <- tklabel(tt,text="Decision Tree GUI")
>button.widget <- tkbutton(tt,text="Select SPSSFile",
>command=function()  read.spss("C:/Cummulative/data/wekaSpecial.sav",
>use.value.label=T,to.data.frame=T))
>tkpack(label.widget,button.widget)
>tkdestroy(tt))
>
>
>....how i have to use  command=function()  that this works like
>cat command ( i get no error message but nothing happen),or better
>how can i replace it with  tkgetOpenFile and do than an assignment 
>to a read.table,read.delim or read.spss command ?
>
>i experiment with deparse and substitute, but get no success !
>
>really thanks for advance
>and regards,Christian
>
>
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
>Send "info", "help", or "[un]subscribe"
>(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list