On 1/8/07, Stephen Eglen <[EMAIL PROTECTED]> wrote: > > Hi, > > I have some spatiotemporal data that I currently visualise by doing a > simple loop, along the lines of: > > for (t in 1:100) { > plot.data(t) > } > > plot.data(t) is a simple function that displays a 2-d plot in an R > window of the data at time t. > > This is okay, but quite restrictive (e.g. currently I have to Ctrl-C > to break out of the loop); I'd like to build a simple GUI (in tk) that > would provide a slider to control where to start showing the data > from, and start/stop buttons to control display of the data. > > I've looked at some of the online resources (including the very useful > set of tk scripts at > http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/ but I can't seem > to find anything like this. Ousterhout's book (Tcl and the Tk > Toolkit) mentions on page 400 timer events, such as > Tk_CreateTimerHandler, which may be useful. But has anyone ventured > in this direction before?
I admit I am not familiar with the tcltk package, but it sounds to me that you want to yield to the GUI event loop and check whether the stop button has been pressed. Calling Sys.sleep(1) in the loop will allow the button handler to be called. Just have it set some flag that lets you break out of the loop. Michael Thanks, Stephen > > p.s. The link to GraspeR on > http://www.sciviews.org/_rgui/projects/TclTk.html is broken; a newer > link is http://www.cscf.ch/grasp/grasp-r/index.html > > _______________________________________________ > R-SIG-GUI mailing list > R-SIG-GUI@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-gui > [[alternative HTML version deleted]] _______________________________________________ R-SIG-GUI mailing list R-SIG-GUI@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-gui