[pygtk] funkiness with gtk constants and CellRendererPixbuf

Timo timomlists at gmail.com
Thu Aug 19 02:11:24 WST 2010


On 18-08-10 12:01, Greg Bair wrote:
> Hi all,
>
> When setting an attribute for a CellRendererPixbuf like so:
>
> column.add_attribute(render_pixbuf, 'stock-size', gtk.ICON_SIZE_BUTTON)
>
> I got the following error:
>
> Warning: unable to set property `stock-size' of type `guint' from value
> of type `gchararray'
>
> The GTK+ C ref says that these are the correct constants to use.  What
> am I doing wrong?
Have you looked at the PyGTK reference manual? 
http://www.pygtk.org/docs/pygtk/class-gtktreeviewcolumn.html#method-gtktreeviewcolumn--add-attribute

It would be something like:
column.add_attribute(render_pixbuf, 'pixbuf', 0) # Last value is the 
number of the column

Cheers,
Timo

> BTW, the stock icon is gtk.STOCK_APPLY, if that helps
> any.
>
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>    



More information about the pygtk mailing list