I feel that it should be pretty simple, but I think I'm missing something.
So, I want to set a window icon with one of the images. I tried:
windowIcon = gtk.image_new_form_stock(gtk.STOCK_DIALOG_AUTHENTICATION, gtk.ICON_SIZE_MENU) window.set_icon(windowIcon.get_pixbuf())
Python then complains that:
File "./sample.py", line 44, in init
window.set_icon (windowIcon.get_pixbuf ())
ValueError: image must be GdkPixbuf or empty
I am trying to convert gtkImage to GdkPixbuf because when I did not write python,
Icon TypeError: Must be GdkPixbuf or None
The pygtk documentation says:
If the image store type is not gtk.IMAGE_EMPTY or gtk.IMAGE_PIXBUF, a ValueError exception is thrown.
So, I assume that the storage type of the source image is wrong. The question is, how do I get around this?
source share