]>
Commit | Line | Data |
---|---|---|
be05b434 RD |
1 | import wx |
2 | ||
3 | class GaugeFrame(wx.Frame): | |
4 | def __init__(self): | |
5 | wx.Frame.__init__(self, None, -1, 'Gauge Example', | |
6 | size=(350, 150)) | |
7 | panel = wx.Panel(self, -1) | |
8 | self.count = 0 | |
9 | self.gauge = wx.Gauge(panel, -1, 50, (20, 50), (250, 25)) | |
10 | self.gauge.SetBezelFace(3) | |
11 | self.gauge.SetShadowWidth(3) | |
12 | self.Bind(wx.EVT_IDLE, self.OnIdle) | |
13 | ||
14 | def OnIdle(self, event): | |
15 | self.count = self.count + 1 | |
16 | if self.count >= 50: | |
17 | self.count = 0 | |
18 | self.gauge.SetValue(self.count) | |
19 | ||
20 | if __name__ == '__main__': | |
21 | app = wx.PySimpleApp() | |
22 | GaugeFrame().Show() | |
23 | app.MainLoop() |