pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)
pixbf = pixbuf.get_from_drawable(disp.pixmap, disp.pixmap.get_colormap(), 0,
    0, 0, 0, width, height)
pixbf.save('path.png')
ValueError while trying to save a pixmap as a png file