def image_from_path(path, size=48, image=None):
gimage = Gtk.Image() if image is None else image
try:
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(path, size, size, True)
gimage.set_from_pixbuf(pixbuf)
except GLib.Error:
pass
return gimage
评论列表
文章目录