Changeset 583 for pygtkimageview/tests/demo05.py
- Timestamp:
- 10/26/08 18:41:30 (5 years ago)
- Files:
-
- pygtkimageview/tests/demo05.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pygtkimageview/tests/demo05.py
r581 r583 2 2 This example demonstrates how to progressively load images and 3 3 animations into an AnimView using a PixbufLoader. 4 5 See http://trac.bjourne.webfactional.com/ticket/11 for why this is the6 right way to load animations. The PixbufLoader doesn't emit the first7 frame of an animation before it is completed, so you have to load the8 first frame as a pixbu and then switch to an animation.9 4 ''' 10 5 import gobject … … 38 33 39 34 def area_prepared_cb(loader): 40 view.set_ pixbuf(loader.get_pixbuf())35 view.set_anim(loader.get_animation()) 41 36 loader.connect('area-prepared', area_prepared_cb) 42 37 43 38 def area_updated_cb(loader, x, y, width, height): 44 anim = loader.get_animation() 45 if anim.is_static_image(): 46 view.damage_pixels((x, y, width, height)) 47 else: 48 view.set_anim(anim) 49 loader.disconnect(con) 50 con = loader.connect('area-updated', area_updated_cb) 39 view.damage_pixels((x, y, width, height)) 40 loader.connect('area-updated', area_updated_cb) 51 41 52 42 # Get the number of bytes to load per iteration.
