Displaying 3 results from an estimated 3 matches for "eventenv".
2011 Dec 16
2
Event handling in R
...her on a non-NULL value from one of the event handlers or for a user-interrupt for it to halt (as per the R manual).
The only way that I've thought of to make this work is using setTimeLimit to kill the function after a set time - here's a (messy) example:
setTimeLimit(cpu = 1)
plot(0, 0)
eventEnv <- getGraphicsEventEnv()
setGraphicsEventHandlers(prompt = 'Test')
while(TRUE)
{
err <- try(q <- getGraphicsEvent(), silent=TRUE)
print(err)
}
# Not run
setTimeLimit(cpu = Inf)
but setTimeLimit doesn't seem to kill getGraphicsEvent() properly, as running this code just...
2016 Sep 17
2
Handlers in setGraphicsEventHandlers() can recursively call getGraphicsEvent(). Intended behavior?
...=======
--- src/main/gevents.c (revision 71293)
+++ src/main/gevents.c (working copy)
@@ -211,8 +211,6 @@
int i;
SEXP handler, bvec, sx, sy, temp, result;
- dd->gettingEvent = FALSE; /* avoid recursive calls */
-
PROTECT(handler = findVar(install(mouseHandlers[event]), dd->eventEnv));
if (TYPEOF(handler) == PROMSXP) {
handler = eval(handler, dd->eventEnv);
@@ -242,7 +240,7 @@
R_FlushConsole();
}
UNPROTECT(1); /* handler */
- dd->gettingEvent = TRUE;
+
return;
}
@@ -257,8 +255,6 @@
{
SEXP handler, skey, temp, result;
- dd->gett...
2020 Aug 09
0
Interactive graphics
...tGraphicsEvent(prompt = "Waiting for input",
???????????????? onMouseDown = NULL, onMouseMove = NULL,
???????????????? onMouseUp = NULL, onKeybd = NULL,
???????????????? onIdle = NULL,
???????????????? consolePrompt = prompt)
setGraphicsEventHandlers(which = dev.cur(), ...)
getGraphicsEventEnv(which = dev.cur())
setGraphicsEventEnv(which = dev.cur(), env)
The problem rises when trying to get interrupts generated by pressing
mouse buttons and, at the same time, interrupts coming from widgets. The
idea is to locate points under a spectrum and draw a baseline.
?In my code the logical se...