我试图用wx python编写一个gui应用程序,我需要控制计时器事件的间隔.这是我目前的代码:
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.on_timer, self.timer)
self.timer.Start(750) # start timer after a delay
Run Code Online (Sandbox Code Playgroud)
这是正确的框架,但我无法控制EVT_TIMER发生的间隔或频率.我一直试图找出使用wx TimerEvent类但没有任何运气.我觉得这应该是我需要的,但它不起作用:
self.timer = wx.Timer(self)
self.timerEvent = wx.TimerEvent(self.timer.GetId(),10)
self.Bind(wx.EVT_TIMER, self.on_timer, self.timer)
Run Code Online (Sandbox Code Playgroud)
谢谢!
| 归档时间: |
|
| 查看次数: |
8894 次 |
| 最近记录: |