Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel QuiƱones <manuel.por.aca@gmail.com>2011-05-16 18:38:36 (GMT)
committer Manuel QuiƱones <manuel.por.aca@gmail.com>2011-05-16 18:38:36 (GMT)
commitcaa50d0ed6226956c0332b59024459502091b861 (patch)
treee741c838cff050354f123cf6f43be5409562315f
parentb7041e19984e043216a2eb2a0efa345fdb6db185 (diff)
Show clock on start
-rwxr-xr-xclock.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/clock.py b/clock.py
index 2d22a32..3560042 100755
--- a/clock.py
+++ b/clock.py
@@ -392,6 +392,9 @@ class ClockFace(gtk.DrawingArea):
"""
super(ClockFace, self).__init__()
+ # Set to True when the variables to draw the clock are set:
+ self.initialized = False
+
# The time on the clock face
self._time = datetime.now()
self._old_minute = self._time.minute
@@ -458,6 +461,7 @@ class ClockFace(gtk.DrawingArea):
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 context.
@@ -465,6 +469,9 @@ class ClockFace(gtk.DrawingArea):
automatically created to draw on it before the expose event is called and
it prevents the screen from flickering.
"""
+ if not self.initialized and self.window:
+ self.queue_resize()
+
if self._active:
self._gc = self.window.new_gc()