dabo Commit
Revision 5936
Date: 2010-07-27 05:21:01 -0700 (Tue, 27 Jul 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5936

Changed:
U   trunk/demo/samples/dGauge.py

Log:
Added a check for dead objects, as reported by JacekK.

Also cleaned up white space.


Diff:
Modified: trunk/demo/samples/dGauge.py
===================================================================
--- trunk/demo/samples/dGauge.py        2010-07-23 17:36:01 UTC (rev 5935)
+++ trunk/demo/samples/dGauge.py        2010-07-27 12:21:01 UTC (rev 5936)
@@ -10,36 +10,36 @@
        def afterInit(self):
                sz = self.Sizer = dabo.ui.dSizer("v")
                sz.appendSpacer(25)
-               
+
                bsz = dabo.ui.dBorderSizer(self, "v", Caption="Horizontal 
Gauge")
                self.gaugeH = dabo.ui.dGauge(self)
-               bsz.append(self.gaugeH, "x", border=30, 
-                       borderSides=("Left", "Right"))
-               
+               bsz.append(self.gaugeH, "x", border=30,
+                               borderSides=("Left", "Right"))
+
                self.lblH = dabo.ui.dLabel(self)
                bsz.append(self.lblH, halign="center")
                sz.append(bsz, "x", halign="center", border=20, 
borderSides=("Left", "Right"))
                sz.appendSpacer(50)
-               
+
                hsz = dabo.ui.dBorderSizer(self, "h", Caption="Vertical Gauge")
                self.gaugeV = dabo.ui.dGauge(self, Orientation="v")
                hsz.append(self.gaugeV, "x", border=30, borderSides=("Left", 
"Right"), halign="center")
                hsz.appendSpacer(10)
-               
+
                self.lblV = dabo.ui.dLabel(self)
                hsz.append(self.lblV, valign="middle")
                sz.append(hsz, 1, halign="center")
-               
+
                self.tmr = dabo.ui.callEvery(500, self.updateGauges)
                self.update()
                self.layout()
-               
-               
-               
+
+
+       @dabo.ui.deadCheck
        def updateGauges(self):
                increase = random.randrange(3,10)
                gh = self.gaugeH
-               val = gh.Value + increase 
+               val = gh.Value + increase
                if val > gh.Range:
                        val -= gh.Range
                gh.Value = val
@@ -47,13 +47,14 @@
 
                increase = random.randrange(3,10)
                gv = self.gaugeV
-               val = gv.Value + increase 
+               val = gv.Value + increase
                if val > gv.Range:
                        val -= gv.Range
                gv.Value = val
                self.lblV.Caption = "%s%% complete" % int(gv.Percentage)
                self.layout()
-       
+
+
        def onDestroy(self, evt):
                self.tmr.stop()
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to