Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Martin <gary@garycmartin.com>2011-05-30 14:57:33 (GMT)
committer Gary Martin <gary@garycmartin.com>2011-05-30 14:57:33 (GMT)
commit476e15db1ef757802b20ff8122bad7f4f915ba23 (patch)
tree27c72eb6074f93af5be296994d4d1839892cfa2f
parent9e5d72bf09d1b0adb667d84cb3e05134954cfcd9 (diff)
Removed unnecessary widget.window test to avoid Traceback on first run.
-rwxr-xr-xclock.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/clock.py b/clock.py
index 3854479..87e0324 100755
--- a/clock.py
+++ b/clock.py
@@ -484,22 +484,21 @@ class ClockFace(gtk.DrawingArea):
the parameters which are important for our rendering (center
of the clock, radius).
"""
- if widget.window:
- # Store the measures of the clock face widget
- self._center_x = int(allocation.x + allocation.width / 2.0)
- self._center_y = int(allocation.y + allocation.height / 2.0)
- self._radius = max(min(int(allocation.width / 2.0), \
- int(allocation.height / 2.0)) - 20, 0)
- self._width = allocation.width
- self._height = allocation.height
- self._line_width = int(self._radius / 150)
-
- # Reload the cached pixbuf
- self._cache_pixbuf = gdk.pixbuf_new_from_file_at_size("clock.svg",
- 2 * self._radius, 2 * self._radius)
- gc.collect() # Reclaim memory from old pixbuf
-
- self.initialized = True
+ # Store the measures of the clock face widget
+ self._center_x = int(allocation.x + allocation.width / 2.0)
+ self._center_y = int(allocation.y + allocation.height / 2.0)
+ self._radius = max(min(int(allocation.width / 2.0), \
+ int(allocation.height / 2.0)) - 20, 0)
+ self._width = allocation.width
+ self._height = allocation.height
+ self._line_width = int(self._radius / 150)
+
+ # Reload the cached pixbuf
+ self._cache_pixbuf = gdk.pixbuf_new_from_file_at_size("clock.svg",
+ 2 * self._radius, 2 * self._radius)
+ gc.collect() # Reclaim memory from old pixbuf
+
+ self.initialized = True
def _expose_cb(self, widget, event):
"""The widget is exposed and must draw itself on the graphic