[cairo] Dynamic Drawing in Cairo and wxPython

Hakki Dogusan dogusanh at tr.net
Tue Jul 24 23:51:37 PDT 2012


Hi,

25-07-2012 04:04 tarihinde, Jeremy Overman yazdı:
> Hi! I'm working on a new project that is written using wxPython and Cairo
> in order to dynamically draw objects on a canvas. Everything works pretty
> well, though I'm noticing a big caveat with wxPython that I'm having a hard
> time working around. I'm am fairly new to wxPython, and very new to Cairo,
> so the answer may be obvious, but I can't seem to find it anywhere.
>
> The problem I'm running into is that it seems that you are only able to
> draw on the graphics context (wx.GraphicsContext, I believe) when
> wx.EVT_PAINT is called, though I need external classes to be able to draw
> to the canvas easily.
>
> My original plan was to create the Cairo context then store it in the class
> that the canvas is on, then any class that needs access to the context to
> draw would simple get it using something like canvas.ctx.
>
> My overall question is, is there any way that I can have access to the
> Cairo Context without needing wx.EVT_PAINT being calling?
>
> [snip]
>

Have a look at wxWindowDC, wxClientDC.


> [snip]
>
> Thank you!
>
>
>

--
Regards,
Hakki Dogusan



More information about the cairo mailing list