]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/buttons.py
Using buffered drawing won't let the themed background show through,
[wxWidgets.git] / wxPython / wx / lib / buttons.py
index efb71b8e8a9a2dc4367922fa1f885fc1c303178d..ea8fea98b5a49ae875e2ad72c6e694ebac0ed817 100644 (file)
@@ -262,7 +262,7 @@ class GenButton(wx.PyControl):
         x2 = width-1
         y2 = height-1
         
         x2 = width-1
         y2 = height-1
         
-        dc = wx.BufferedPaintDC(self)
+        dc = wx.PaintDC(self)
         brush = None
         
         if self.up:
         brush = None
         
         if self.up:
@@ -312,8 +312,9 @@ class GenButton(wx.PyControl):
             if not self.up:    # if the button was down when the mouse was released...
                 self.Notify()
             self.up = True
             if not self.up:    # if the button was down when the mouse was released...
                 self.Notify()
             self.up = True
-            self.Refresh()
-            event.Skip()
+            if self:           # in case the button was destroyed in the eventhandler
+                self.Refresh()
+                event.Skip()
 
 
     def OnMotion(self, event):
 
 
     def OnMotion(self, event):