[pygtk] funkiness with gtk constants and CellRendererPixbuf
Greg Bair
gregbair at gmail.com
Thu Aug 19 09:15:51 WST 2010
On Thu, 2010-08-19 at 08:56 +1200, Tim Evans wrote:
> 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
>
Thanks, I didn't quite put together that the add_attribute was used that
way. Thanks for the help.
More information about the pygtk
mailing list