[Rd] Refreshing the GUI and packing images

From: Filipe Santos <santos_at_ensam.inra.fr>
Date: Tue 23 Jan 2007 - 17:14:55 GMT


Dear all

I'm developing a grafical interface for Geneland that is presently one of the R packages available.

My first question is about refreshing the interface while running a very long process.

run<-function(){

        tttry <- tktoplevel()
        tkwm.geometry(tttry, "+200+200")
        tkwm.title(tttry,"wait")
        warn<-tklabel(tttry,image=imagepleasewait)
        tkpack(warn)                        
        tkfocus(tttry)
        tcl("update")
               
        print("Starting...")

        validate <- 1

    

        onIdle <- function(){
          if (validate)==1){
            Sys.sleep(0.1)
            tkconfigure(warn,image=imagepleasewait)
            tcl("after","idle", onIdle())
          }
          else
            tkdestroy(tttry)
        }
        onIdle()

        mcmcFmodel(...)  
       
        validate <- 0

}

If I remove the onIdle funtion the GUI stucks when I'm executing the mcmcFmodel, if I leave it neves calls mcmcFmodel. Then I thought that there could exist a fork() equivalent in R or somehow send a process to background but I couldn't find anyway to make that with R-base package.

My second question is in which directory images are supposed to be packed? R has a strict directory rules for packages and there is no documentation regarding where should images for GUIs be putten. I was looking at SciViews package and they distribute that under a directory called gui.

Best regards

Filipe Santos



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Jan 24 04:46:57 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 24 Jan 2007 - 09:31:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.