[cairo] pycairo with glitz on OSX?

Steven Chaplin stevech1097 at yahoo.com.au
Mon Sep 10 04:45:41 PDT 2007

On Thu, 2007-09-06 at 14:24 -0500, Thomas Hansen wrote:
> I've been trying to find out whether I can write python applications  
> that use cairo to draw to a glitz accelerated window on OSX.
Its not currently possible.

> I cant  
> find much documentation, so i was wondering if anyone has tried  
> something like this before?  Can I even use a glitz back end with the  
> python bindings?
No, see below.

> If so, would I need to run an X server on OSX, or  
> could I get  a glitz accelerated surface into a window through some  
> OSX python bindings?

I can't comment much on glitz or OSX since I don't use them. I would
suggest installing cairo and glitz and test if the C libraries work on
OSX. If they do then in theory it should be possible for (updated)
Python bindings to work on OSX too.

The NOTES file in the pycairo source lists the cairo surfaces which
pycairo can use - the glitz surface is not currently supported.
Pycairo provides bindings for cairo, and glitz is not part of cairo, its
an independent C library. For pycairo to use a glitz backend a "pyglitz"
Python module would need to be created so that pycairo could access a
glitz surface.

> I have successfully installed  Python 2.5, X11, cairo 1.4, and pycairo 
> (compiled from source) and can make use of the cairo library from my  
> python scripts.  However I ca'nt figure out how to output to anything  
> else than a png file.  (I have successfully rendered to a GTK window  
> from python on Ubuntu, but haven't tried it on OSX)

You should be able to output to PS, PDF, SVG and GTK windows. The
"examples/cairo_snippets/" directory of the pycairo source has examples
showing how to do this.


More information about the cairo mailing list