]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Gauge.py
Undid last commit and restored bool argument to wxFrame::DoGiveHelp() as
[wxWidgets.git] / wxPython / demo / Gauge.py
index 5d65255f0951c1098dec63c5ea4fde25f03d0ede..d53bcdbf3324ded5df150c42892786aa3a1a2099 100644 (file)
@@ -1,7 +1,3 @@
-# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Updated for wx namespace
-# 
 
 import  wx
 
 
 import  wx
 
@@ -13,33 +9,27 @@ class TestPanel(wx.Panel):
         self.log = log
         self.count = 0
 
         self.log = log
         self.count = 0
 
-        wx.StaticText(self, -1, "This example shows the wxGauge control.", (45, 15))
+        wx.StaticText(self, -1, "This example shows the wx.Gauge control.", (45, 15))
 
         self.g1 = wx.Gauge(self, -1, 50, (110, 50), (250, 25))
 
         self.g1 = wx.Gauge(self, -1, 50, (110, 50), (250, 25))
-        self.g1.SetBezelFace(3)
-        self.g1.SetShadowWidth(3)
+        self.g2 = wx.Gauge(self, -1, 50, (110, 95), (250, 25))
 
 
-        self.g2 = wx.Gauge(
-                    self, -1, 50, (110, 95), (250, 25), 
-                    wx.GA_HORIZONTAL|wx.GA_SMOOTH
-                    )
+        self.Bind(wx.EVT_TIMER, self.TimerHandler)
+        self.timer = wx.Timer(self)
+        self.timer.Start(100)
 
 
-        self.g2.SetBezelFace(5)
-        self.g2.SetShadowWidth(5)
+    def __del__(self):
+        self.timer.Stop()
 
 
-        self.Bind(wx.EVT_IDLE, self.IdleHandler)
-
-
-    def IdleHandler(self, event):
+    def TimerHandler(self, event):
         self.count = self.count + 1
 
         if self.count >= 50:
             self.count = 0
 
         self.g1.SetValue(self.count)
         self.count = self.count + 1
 
         if self.count >= 50:
             self.count = 0
 
         self.g1.SetValue(self.count)
-        self.g2.SetValue(self.count)
-
-
+        self.g2.Pulse()
+    
 
 #----------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------
 
@@ -66,5 +56,5 @@ to present the same sort of control as a dialog to the user.
 if __name__ == '__main__':
     import sys,os
     import run
 if __name__ == '__main__':
     import sys,os
     import run
-    run.main(['', os.path.basename(sys.argv[0])])
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])