[cairo] pycairo subclass

Steven Chaplin stevech1097 at yahoo.com.au
Sun Dec 9 17:25:46 PST 2007


On Fri, 2007-12-07 at 16:51 -0800, cairo-request at cairographics.org
wrote:
> Hi all,
> 
> I'd like to make a python subclass of "cairo.Context". I'm getting
> errors no mattter how I'm doing that.
> 
> Could anyone give me an example of such subclass?
> 
> Is it possible at all?
> 
> (cairo-1.4.10, pycairo-1.4.0, Python 2.4.4)
> 

Hi zs,
cairo.Context currently allows subclassing. But has no support for
adding new attributes or methods, so subclassing is not very useful!
(cairo.Context can be subclassed using C - python gtk and pango
successfully do so.)

The cairo bindings doc 'Memory Management' page describes why its not a
good idea to subclass cairo surfaces. So should cairo.Context be kept
consistent with cairo surfaces, and not allow subclassing, or is
cairo.Context a special case which should allow subclassing?
How useful would subclassing cairo.Context be?

Regards,
Steve




More information about the cairo mailing list