Use wx.AutoBufferedPaintDC instead of wx.BufferedPaintDC (helps with drawing on linux)

This commit is contained in:
blitzmann
2017-11-21 00:05:52 -05:00
parent a52b9e58e9
commit 0f94557699
10 changed files with 36 additions and 14 deletions

View File

@@ -24,6 +24,8 @@ class LoadAnimation(wx.Window):
self.animTimer.Start(self.animTimerPeriod)
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
def Play(self):
if self.animTimer.IsRunning():
self.animTimer.Stop()
@@ -52,7 +54,7 @@ class LoadAnimation(wx.Window):
def OnPaint(self, event):
rect = self.GetClientRect()
dc = wx.BufferedPaintDC(self)
dc = wx.AutoBufferedPaintDC(self)
windowColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
dc.SetBackground(wx.Brush(windowColor))
dc.Clear()