[R-gui] Idle/timer callbacks in tk widgets

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Mon Jan 8 18:46:33 CET 2007


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?

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



More information about the R-SIG-GUI mailing list