def OnPaint(self, event): dc = wx.PaintDC(self) DrawMyDocument(dc)