Skip to content
Prev 280376 / 398506 Next

Event handling in R

...because you're catching the timeout error with try() so it has not
effect, and hence the while(TRUE) {} loop keeps running.

Without knowing anything about graphics event handlers per se, here's
an alternative to catch the timeout event:

library("R.utils");

plot(0, 0);
eventEnv <- getGraphicsEventEnv();
setGraphicsEventHandlers(prompt='Test');

q <- NULL;
evalWithTimeout({
  q <- getGraphicsEvent();
}, timeout=1);
print(q);

does it.  See print(evalWithTimeout) to see what you are doing differently.

My $.02

/Henrik
On Thu, Dec 15, 2011 at 9:49 PM, beetonn <Nicholas.Beeton at utas.edu.au> wrote: