Nigel Tao wrote:
I have a GtkDialog for which I want to: dialog.set_icon(gtk.image_new_from_stock(gtk.STOCK_FIND, gtk.ICON_SIZE_MENU).get_pixbuf())
but I get the following error: ValueError: image should be a GdkPixbuf or empty
Indeed, the PyGTK docs ( http://www.pygtk.org/pygtk2reference/class- gtkimage.html#method-gtkimage--get-pixbuf ) say that exactly that will happen - get_storage_type() on the image returns GTK_IMAGE_STOCK, which is not GTK_IMAGE_PIXBUF.
Fair enough. So how do I instead set a window's icon to a stock image? Alternatively, how do I get a pixbuf from a stock image?
(If somebody answers, can it be added to the PyGTK FAQ at
http://www.async.com.br/faq/pygtk/index.py?
req=show&file=faq10.007.htp ?)
You can use:
http://www.pygtk.org/pygtk2reference/class-gtkwidget.html#method-gtkwidget--render-icon
to get the pixbuf to use with
http://www.pygtk.org/pygtk2reference/class-gtkwindow.html#method-gtkwindow--set-icon
John
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
