Hi dear R list,
I would like to create a graphical user interface with tcltk.I want to have a 
window where the user will enter a numeric, this will open a message box with 
his value. This works, but I don't succeed to get the value x, to use it after 
in a script in the R console. The x variable doesn't give me the value chosen 
by the user but returns the initial value "12".How can I do it ? Does exist an 
another function in tcltk that I need to use ?Thanks for your help
Céline
Here is my code :
library(tcltk2)
tt<-tktoplevel()
tktitle(tt)<-"Select a value"
titre<-tklabel(tt, text="Select a value")
value<-tkentry(tt, width=3, textvariable=tclVar("12"))
ok<-function()
{
    show<-paste("The value is :", tclvalue(tkget(value)))
    tkmessageBox(title="End", message=show, icon="info", type="ok")
    tkdestroy(tt)
}

bouton<-tkbutton(tt, text="OK", command=ok)
tkpack(titre)
tkpack(value,bouton)
x<-tclvalue(tkget(value))
x<-as.numeric(x)
x #this give 12 but I want to have the new value


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to