]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | import wx | |
3 | ||
4 | class TestPanel(wx.Panel): | |
5 | def __init__(self, parent): | |
6 | wx.Panel.__init__(self, parent) | |
7 | self.gauge = wx.Gauge(self, range=100, pos=(20,20), size=(100,-1)) | |
8 | self.Bind(wx.EVT_IDLE, self.OnIdle) | |
9 | self.count = 1 | |
10 | self.skipNext = False | |
11 | ||
12 | def OnIdle(self, evt): | |
13 | if self.skipNext: | |
14 | self.skipNext = False | |
15 | return | |
16 | self.skipNext = True | |
17 | ||
18 | print "OnIdle:", self.count | |
19 | #self.gauge.SetValue(self.count) | |
20 | self.count += 1 | |
21 | if self.count >= 100: | |
22 | self.count = 1 | |
23 | ||
24 | ||
25 | ||
26 | app = wx.App(False) | |
27 | frm = wx.Frame(None) | |
28 | pnl = TestPanel(frm) | |
29 | frm.Show() | |
30 | app.MainLoop() |