# File gtk/sample/gtk-demo/images.rb, line 140
    def progressive_timeout(image)
      if @image_stream
        buf = @image_stream.read(1024)
        
        @pixbuf_loader.write(buf)
        
        if @image_stream.eof?
          @image_stream.close
          @image_stream = nil
          
          @pixbuf_loader.close
          @pixbuf_loader = nil
          
          return false
        end
      else
        filename = Demo.find_file('alphatest.png')
        @image_stream = File.open(filename, 'rb')

        if @pixbuf_loader != nil
          @pixbuf_loader.close
          @pixbuf_loader = nil
        end
        
        @pixbuf_loader = Gdk::PixbufLoader.new
        
        @pixbuf_loader.signal_connect('area_prepared') do |loader|
          pixbuf = loader.pixbuf

          # Avoid displaying random memory contents, since the pixbuf
          # isn't filled in yet.
          pixbuf.fill!(0xaaaaaaff)
          
          image.pixbuf = pixbuf
        end
        
        @pixbuf_loader.signal_connect('area_updated') do
          # We know the pixbuf inside the Gtk::Image has changed, but the image
          # itself doesn't know this; so queue a redraw.  If we wanted to be
          # really efficient, we could use a drawing area or something
          # instead of a Gtk::Image, so we could control the exact position of
          # the pixbuf on the display, then we could queue a draw for only
          # the updated area of the image.
          image.queue_draw
        end
      end
      
      # leave timeout installed
      return true
    end