I've got a problem with DCs. I'm trying to make an application that will draw many lines on the screens and needs to update really fast, and since I don't want flickering, I decided to give buffered dcs a shot. But when I run this code, it doesn't draw anything. What am I doing wrong?
import wx
class MainFrame(wx.Frame):
def __init__(self):
screensize = wx.GetDisplaySize()
self.framesize = (screensize[0]/4*3, screensize[1]/4*3)
wx.Frame.__init__(self, None, -1, "CursorTracker", size=self.framesize,
style=wx.SYSTEM_MENU|
wx.CAPTION|
wx.CLOSE_BOX|
wx.MINIMIZE_BOX)
self.dc = wx.ClientDC(self)
self.bdc = wx.BufferedDC(self.dc)
self.SetBackgroundColour(wx.WHITE)
self.Timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.OnTimer)
self.Timer.Start(100)
def OnTimer(self, event):
self.bdc.DrawLine(1,1,100,100)
class App(wx.App):
def OnInit(self):
frame = MainFrame()
frame.Show()
return True
app = App(redirect=False)
app.MainLoop()