X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5193b348e83ce2d8117e96ee269a099e2528f544..3d2d9036037d9ee51f47d878c3dcef4af4a6ef41:/wxPython/wx/lib/statbmp.py diff --git a/wxPython/wx/lib/statbmp.py b/wxPython/wx/lib/statbmp.py index fa2db42356..bd4ab44514 100644 --- a/wxPython/wx/lib/statbmp.py +++ b/wxPython/wx/lib/statbmp.py @@ -21,7 +21,9 @@ class GenStaticBitmap(wx.PyControl): pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0, name = "genstatbmp"): - wx.PyControl.__init__(self, parent, ID, pos, size, style|wx.NO_BORDER, + if not style & wx.BORDER_MASK: + style = style | wx.BORDER_NONE + wx.PyControl.__init__(self, parent, ID, pos, size, style, wx.DefaultValidator, name) self._bitmap = bitmap self.InheritAttributes() @@ -72,7 +74,8 @@ class GenStaticBitmap(wx.PyControl): def OnPaint(self, event): dc = wx.PaintDC(self) - dc.DrawBitmap(self._bitmap, 0, 0, True) + if self._bitmap: + dc.DrawBitmap(self._bitmap, 0, 0, True) def OnEraseBackground(self, event):