diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-05-30 01:38:43 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-05-30 01:38:43 (GMT) |
commit | 3284fa3f44095f5d1647867f195feffedaef9d2b (patch) | |
tree | a01c23765fdf04e2d03de21cae15412ea772f1fe | |
parent | f46b80d4a8c3b581ac4a82f8d60dd8d8ffbe9e2d (diff) |
Migrating from file_path to pixbuf
-rw-r--r-- | animation.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/animation.py b/animation.py index 4dd810a..6919cfd 100644 --- a/animation.py +++ b/animation.py @@ -74,14 +74,14 @@ class Animation(gtk.Image): def add_image(self, image_path): """Appends an image to the list""" - self.images.append(image_path) + pixbuf = gtk.gdk.pixbuf_new_from_file(image_path) + self.images.append(pixbuf) def run(self): """Runs the animation""" if not self._running: try: - pixbuf = gtk.gdk.pixbuf_new_from_file(self.images[ - self._current_image]) + pixbuf = self.images[self._current_image] width = pixbuf.get_width() height = pixbuf.get_height() max_size = max(width, height) @@ -106,7 +106,7 @@ class Animation(gtk.Image): def set_pos(self, pos): self._current_image = pos - pixbuf = gtk.gdk.pixbuf_new_from_file(self.images[self._current_image]) + pixbuf = self.images[self._current_image] width = pixbuf.get_width() height = pixbuf.get_height() max_size = max(width, height) |