def __init__(self, id_, url, cancellable, gallery):
Gtk.Button.__init__(self)
self.id_ = id_
def download_complete_cb(loader, path):
width, height = ThumbnailGallery.THUMBNAIL_SIZE_CONTRAINTS
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
path,
width, height, # width, height constraints
True) # respect image proportionality
im = Gtk.Image.new_from_pixbuf(pixbuf)
self.add(im)
self.show_all()
loader = SimpleFileDownloader()
loader.connect("file-download-complete", download_complete_cb)
loader.download_file(
url, use_cache=ScreenshotGallery.USE_CACHING)
self.connect("draw", self.on_draw)
评论列表
文章目录