diff options
author | Gary Martin <gary@garycmartin.com> | 2011-05-29 15:18:03 (GMT) |
---|---|---|
committer | Gary Martin <gary@garycmartin.com> | 2011-05-29 15:18:03 (GMT) |
commit | c465963769443cb31f179ab8982e9fa3bfd2701a (patch) | |
tree | cc498bb43c9039eb0dbe875d4d16fcdc86a816e4 /clock.py | |
parent | e188d0a81203c2275f45a557cdc320b433b44220 (diff) |
Show clock at start SL2196, SL2719, OLPC1085 (patch from manuq)
Diffstat (limited to 'clock.py')
-rwxr-xr-x | clock.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -363,6 +363,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 @@ -429,6 +432,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. @@ -436,6 +440,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() |