From santos at ensam.inra.fr  Tue Jan 23 18:14:55 2007
From: santos at ensam.inra.fr (Filipe Santos)
Date: Tue, 23 Jan 2007 18:14:55 +0100
Subject: [Rd] Refreshing the GUI and packing images
Message-ID: <200701231814.55960.santos@supagro.inra.fr>

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



[Rd] Refreshing the GUI and packing images
Filipe Santos