Changeset 583

Show
Ignore:
Timestamp:
10/26/08 18:41:30 (5 years ago)
Author:
bjourne
Message:

Revert the progressive loading work-around commit in r581. With the
fix in r582 it is no longer needed. See #29.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pygtkimageview/tests/demo05.py

    r581 r583  
    22This example demonstrates how to progressively load images and 
    33animations into an AnimView using a PixbufLoader. 
    4  
    5 See http://trac.bjourne.webfactional.com/ticket/11 for why this is the 
    6 right way to load animations. The PixbufLoader doesn't emit the first 
    7 frame of an animation before it is completed, so you have to load the 
    8 first frame as a pixbu and then switch to an animation. 
    94''' 
    105import gobject 
     
    3833 
    3934    def area_prepared_cb(loader): 
    40         view.set_pixbuf(loader.get_pixbuf()) 
     35        view.set_anim(loader.get_animation()) 
    4136    loader.connect('area-prepared', area_prepared_cb) 
    4237 
    4338    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) 
    5141 
    5242    # Get the number of bytes to load per iteration.