From 1bb650e7209c6a48e4591a3907bbbe0049aebc57 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 24 Dec 2002 00:10:33 +0000 Subject: [PATCH] If zero-size there's nothing to draw... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/lib/stattext.py | 2 ++ 1 file changed, 2 insertions(+) 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())