Skip to content
Prev 6106 / 63421 Next

GUI support from R

Prof Brian D Ripley <ripley@stats.ox.ac.uk> writes:
Actually, the Tcl crowd has been expending some effort on this issue,
and have seemingly come up with a notification structure that is
*designed* to interact with foreign event loops. 

Last I looked, the Tcl sources for the event loops on the three
platforms (X11/Win32/Mac) seemed to be essentially sample code that
could be grafted on to an existing event loop. That didn't look like
particularly simple reading though, and that was even before Tcl/Tk
had threads... (in the version that shipped with RedHat, that is).

I've been wanting to sink my teeth into this stuff for quite a while,
because it annoys me that I understand so little of it and because I
suspect that the issues are really independent of the choice of GUI
and there is a lot to be learned. 

I rather strongly expect that the current Tcl/Tk interface could be
substantially improved in the process. I'm pretty sure that the
PolledEvents method we use now is plainly wrong -- it certainly is on
Unix, where we had an event-handler solution in place originally, but
that didn't work on Windows, at least not in that way. I sort of
suspect that R itself might benefit by a similar centralization of
event handling as Tcl already has, but that might be a pipe dream.

Also, lack of understanding of the work of the Tcl'ers is probably the
main reason that we don't have it on Classic Mac. The input handler
hack that we use on X11 and Windows doesn't seem to port to that
platform (right, Stefano?). Whether this is important for long enough
befor OS X makes the issue moot is of course debatable.