[billreminder] One more sync with hamster-applet.



commit 41e24a3d8b7714d028137985c5dc702cc75ce4a0
Author: Og B. Maciel <ogmaciel gnome org>
Date:   Fri Nov 27 20:34:00 2009 -0500

    One more sync with hamster-applet.

 src/gui/widgets/charting.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/widgets/charting.py b/src/gui/widgets/charting.py
index ff45c0f..75a9616 100644
--- a/src/gui/widgets/charting.py
+++ b/src/gui/widgets/charting.py
@@ -238,9 +238,12 @@ class Chart(graphics.Area):
 
 class BarChart(Chart):
     def on_expose(self):
-        context = self.context
         Chart.on_expose(self)
-        
+
+        if not self.data:
+            return
+
+        context = self.context        
         # determine graph dimensions
         if self.show_stack_labels:
             legend_width = self.legend_width or self.longest_label(self.keys)
@@ -464,8 +467,12 @@ class BarChart(Chart):
 
 class HorizontalBarChart(Chart):
     def on_expose(self):
-        context = self.context
         Chart.on_expose(self)
+
+        if not self.data:
+            return
+
+        context = self.context
         rowcount, keys = len(self.keys), self.keys
         
         # push graph to the right, so it doesn't overlap



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]