I have a cython’ized render routine that writes into a wxMemoryDC. The code to begin this on older versions that used SWIG looks like this:
def drawElements(self, dc, canvas, tick):
"""Draw elements in the list to the given dc
"""
elements = canvas.GetDrawPairs() # Uses bounds
xoff, yoff = canvas.GetRenderOffsets()
background_brushes, reason_brushes = canvas.GetBrushes()
cdef SwigPyObject* ptr = <SwigPyObject*>dc.this
cdef wxDC* c_dc = <wxDC*?>ptr.ptr
assert c_dc != NULL
<and then we continue to do stuff with the pointer to the c++ wxDC>
I should also mention that dc
is passed the results of wx.MemoryDC()
.
After the changeover to SIP, there is no longer a this
attribute on instances of wxMemoryDC()
. Can someone help me understand how I can get to the C++ internals of wxWidgets in my Cython with the 4.0+ version?
Thanks.