Full_Name: PREUSS Bastien Version: R version 2.6.2 (2008-02-08) OS: mingw32 Submission from: (NULL) (193.51.249.166)
Hello, I wrote a small function using tcltk to import my datasets. When I use it, both the tcltk and the R windows closed themselves. I don't understand why. What is surprising is that it doesnt happen each time. Most of the time I can't finish the importation of my 3 data folders, but sometimes I am successful. Here is my function: require(tcltk) import.donnees.f = function() { #### openObservations.f = function(){ name1<-tclvalue(tkgetOpenFile()) if (!nchar(name1)) tkmessageBox(message="Aucun fichier n'a été sélectionné!") else tkmessageBox(message=paste("Vous avez sélectionné le fichier ",name1)) assign("fileName",name1,envir=.GlobalEnv) } openUnitobs.f = function(){ name2<-tclvalue(tkgetOpenFile()) if (!nchar(name2)) tkmessageBox(message="Aucun fichier n'a été sélectionné!") else tkmessageBox(message=paste("Vous avez sélectionné le fichier ",name2)) assign("fileName2",name2,envir=.GlobalEnv) } openListespeces.f = function(){ name3<-tclvalue(tkgetOpenFile()) if (!nchar(name3)) tkmessageBox(message="Aucun fichier n'a été sélectionné!") else tkmessageBox(message=paste("Vous avez sélectionné le fichier ",name3)) assign("fileName3",name3,envir=.GlobalEnv) } tt <- tktoplevel() tkwm.title(tt,"Import des fichiers de données") button.widget <- tkbutton(tt,text="Table de données d'observations ",command=openObservations.f) button.widget2 <- tkbutton(tt,text="Table de données sur les unités d'observation ",command=openUnitobs.f) button.widget3 <- tkbutton(tt,text="Table de données sur les espèces ",command=openListespeces.f) OK.but <- tkbutton(tt,text=" Valider ",command=function() tkdestroy(tt)) tkpack(button.widget,button.widget2,button.widget3,OK.but) tkfocus(tt) tkwait.window(tt) } ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel