diff --git a/wxPython/wxPython/lib/stattext.py b/wxPython/wxPython/lib/stattext.py index 61d4eb70ab..3a3d41f6c8 100644 --- a/wxPython/wxPython/lib/stattext.py +++ b/wxPython/wxPython/lib/stattext.py @@ -101,6 +101,8 @@ class wxGenStaticText(wxPyControl): def OnPaint(self, event): width, height = self.GetClientSize() + if not width or not height: + return dc = wxBufferedPaintDC(self) dc.SetBackground(wxBrush(self.GetBackgroundColour(), wxSOLID)) dc.SetTextForeground(self.GetForegroundColour())