In PyGTK, what is a simple way to show a PNG file?
问题 The following PyGTK code displays a PNG file in a window. Is there a simpler or better way of displaying the PNG file, like, by using a gtk.DrawingArea? For example, how do you resize the file? import gtk import pygtk pygtk.require('2.0') class Gui: def __init__(self): # Create an Image object for a PNG file. file_name = "file.png" pixbuf = gtk.gdk.pixbuf_new_from_file(file_name) pixmap, mask = pixbuf.render_pixmap_and_mask() image = gtk.Image() image.set_from_pixmap(pixmap, mask) # Create a