[pygtk] funkiness with gtk constants and CellRendererPixbuf
Tim Evans
t.evans at aranz.com
Thu Aug 19 04:56:38 WST 2010
On 2010-08-18 22: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? BTW, the stock icon is gtk.STOCK_APPLY, if that helps
> any.
The column.add_attribute method is for adding values that vary down the
column, by pulling each value from a column of the list model. If you
just want to set a constant value for a cell renderer property, use
something like this:
render_pixbuf.props.stock_size = gtk.ICON_SIZE_BUTTON
--
Tim Evans
More information about the pygtk
mailing list