[R-SIG-Mac] interesting R<->Cocoa side effects

Byron Ellis bellis at hsph.harvard.edu
Fri Jul 30 09:45:52 CEST 2004


Hi all, I've been playing with the Cocoa interface that Stefano has 
been putting into R-devel, guided by Simon Urbanek's code 
(incidentally, the RGUI bundle code on Stefano's site while attempting 
to get the console prompt under 2.0.0) and I've discovered some 
interesting properties. In particular, if you take control of the main 
menu the Quartz device causes R to crash. The trouble seems to be that 
the various pointers (GetQuartzParameters and FocusOnConsole for 
instance) don't get installed at startup. I haven't tried the various 
editors and package installation windows yet.

On the plus side it did inspire me to spend some time implementing a 
Cocoa interface for the graphics devices that is 90% 
functional---there's a weird NSView sizing bug (that may actually be on 
the Cocoa side of things) and the fonts are completely wonky (huge, not 
to mention upside down) to work out, but otherwise things seem to be 
working just fine.

It seems like the best solution is to have a "cocoa_graph" bit to set 
that loads the Cocoa device bindings if set and otherwise sets up the 
appropriate Carbon bindings if not such that implementors don't have to 
take control of the graphics device. At any rate, I'll post a diff once 
I get the two problems above sorted out. I'll also be dumping my GUI 
into CVS, likely at the StatPaper site, for people to play. It works a 
little bit differently than Simon's and I'm also experimenting 
unabashedly with Panther facilities like SearchKit for the help system.

It must be the water in California that makes me want to write Cocoa 
code or something :-)

---
Byron Ellis (bellis at hsph.harvard.edu)
"Oook" -- The Librarian



More information about the R-SIG-Mac mailing list