GNOME Bugzilla – Bug 77348
gtk.Image set_from_pixmap - wrong parameter handling
Last modified: 2004-12-22 21:47:04 UTC
gtk.Image.set_from_pixmap(pixmap,mask)... ^^^^^^ ^^^^ Pygtk, requires both parameters to be GdkPixmaps. This is wrong, because: 1) Mask should be a GdkBitmap 2) ither or both parameters can be None (NULL) according to Gtk specification. (Note that 90% of calls to this function set pixmap only) Also it would be nice to have the following function: gtk.image_new_from_file(...)
GdkBitmaps are GdkPixmaps (bitmaps are simply 1-bit pixmaps), so (1) should not be an issue. The second argument should definitely be optional and allow None to be passed. Why would you want to pass None as the first argument?
I don't know why one would like to set mask only (without pixmap), but according to gtk documentation, both parameters are optional (any can be specified as NULL). Check: http://developer.gnome.org/doc/API/2.0/gtk/gtkimage.html#GTK-IMAGE-SET -FROM-PIXMAP
Checked in defs file change to allow None as a mask. Unless there is a good reason why you would want to pass None as the pixmap, I won't add the null-ok flag for that parameter.