[cairo] pyCairo Quartz support

Bobby Powers bobbypowers at gmail.com
Mon Nov 19 23:56:31 PST 2007

On Nov 20, 2007, at 1:14 AM, Steven Chaplin wrote:
> You can mail this list a patch to pyCairo (against the 1.4.0 release)
> adding Quartz support and I'll check if it can be added to pyCairo  
> CVS.
> Regards,
> Steve

I've attached the patch (against 1.4.0) and a basic python class that  
uses Cairo.  It is a subclass of NSView (Apple's Objective-C class for  
drawing to parts of a window - PyObjC provides the bridging support  
and is included in the standard Python distribution in 10.5, I only  
have one machine so I haven't tried building this on OS X v10.4), and  
shows how to get the CGContextRef in python and create the context.   
If you're making a NIB in Interface Builder you can then simply create  
a custom view, and specify its class as 'CairoView.'

This is my first time making and submitting a patch, so if it isn't  
right let me know (I use SVN for some of my own projects, but since  
its me and one other person we don't really use patches).

Bobby Powers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: quartz_support.patch
Type: application/octet-stream
Size: 7986 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20071120/7bda261a/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CairoView.py
Type: text/x-python-script
Size: 699 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20071120/7bda261a/attachment.bin 

More information about the cairo mailing list