It probably wants one.
But you should be able to do something like this, in your Paint event :
Not sure if you need to implicitly free the wxPaintDC too. (you'll find out on Windows soon enough, if you do).
But you should be able to do something like this, in your Paint event :
Function OnPaint(event:wxEvent) Local canvas:MyWidget = MyWidget(event.parent) Local pdc:wxPaintDC = New wxPaintDC.Create(canvas) Local dc:wxGCDC = New wxGCDC.Create(pdc) canvas.PrepareDC(dc) ... dc.Free()
Not sure if you need to implicitly free the wxPaintDC too. (you'll find out on Windows soon enough, if you do).