Callbacks

  PixbufDestroyNotify (pixels, *data)
  PixbufSaveFunc (buf, *data)

Details

GdkPixbuf.PixbufDestroyNotify(pixels, *data)
Parameters:
  • pixels (bytes) – The pixel array of the pixbuf that is being finalized.
  • data (object or None) – User closure data.

A function of this type is responsible for freeing the pixel array of a pixbuf. The GdkPixbuf.Pixbuf.new_from_data() function lets you pass in a pre-allocated pixel array so that a pixbuf can be created from it; in this case you will need to pass in a function of GdkPixbuf.PixbufDestroyNotify so that the pixel data can be freed when the pixbuf is finalized.

GdkPixbuf.PixbufSaveFunc(buf, *data)
Parameters:
  • buf (bytes) – bytes to be written.
  • data (object or None) – user data passed to gdk_pixbuf_save_to_callback().
Returns:

True if successful, False (with error set) if failed.

error:A location to return an error.

Return type:

(bool, error: GLib.Error)

Specifies the type of the function passed to gdk_pixbuf_save_to_callback(). It is called once for each block of bytes that is “written” by gdk_pixbuf_save_to_callback(). If successful it should return True. If an error occurs it should set error and return False, in which case gdk_pixbuf_save_to_callback() will fail with the same error.

New in version 2.4.