[Rd] RE: [R] GUI support from R

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
02 Sep 2001 18:38:40 +0200

Prof Brian D Ripley <ripley@stats.ox.ac.uk> writes:

> Rather, it becomes moot for people who want such facilities.  I suspect
> noone wants to maintain them ....  That Tcl/Tk needs a different low-level
> interface on different platforms is a pain: the original R tcltk package
> code runs on a call that only exists in Tcl/Tk for Unix.  If that were to
> happen again, I am pretty sure that Tcl/Tk would be omitted from the
> Windows port of R (and I believe it is from the Classic Mac port).
> [...]
> Event-loop integration is a major issue with GUIs, and it's a toolkit
> issue.  R is designed to run an event loop and wants to be in control.

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.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch