]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/statbmp.py
Patch from Will Sadkin:
[wxWidgets.git] / wxPython / wx / lib / statbmp.py
index fa2db42356c89927cac926996749a3674de0c19b..bd4ab445145a3e51868d2aa642414a13fa130100 100644 (file)
@@ -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):