Difference between cairo.Context to CairoContext



Hi,


I'm writing an application with clutter in python. Besides the
rendering to screen, done by clutter, I also wanted a part of it to be
exportable to a pdf. To do this I chose to implement the "pdf-parts"
of the interface to extend from Clutter.CairoTexture and to
recursively render all CairoTextures in the plane to a custom cairo
context that paints to the pdf-file.

The problem arises when I manually emit the draw-signal of the
CairoTexture with my own cairo context:

    pdf = cairo.PDFSurface("output.pdf", self.width, self.height)
    ctx = cairo.Context(pdf)
    myCairoTexture.emit("draw", ctx)

    >> TypeError: could not convert type cairo.Context to CairoContext
required for parameter 0

I guess this has something to do with the fact that the cairo context
is a foreign object? I have searched through the pygobject code, but I
didn't find a way to work around this.


Thanks,
Joris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]