[pygtk] gtk.IconView and set_cell_data_func doesn't work together
Iñigo Serna
inigoserna at gmail.com
Mon Nov 22 04:05:59 WST 2010
Hi,
I'm trying to set a custom function to render the images on a
gtk.IconView, instead of the usual "gtk.IconView.set_pixbuf_column()"
method.
To do it, I'm using "set_cell_data_func" method that gtk.IconView
inherits from gtk.CellLayout [1] and [2].
It doesn't work, reporting next error.
"""
iconview.py:19: GtkWarning:
gtk_icon_view_cell_layout_set_cell_data_func: assertion `info != NULL'
failed
self.set_cell_data_func(crpb, self.cell_pixbuf_func)
"""
See the attached example.
Any idea?
I succesfully use "set_cell_data_func" method with treeviews, so the
issue comes within gtk.IconView...
My purpose is to render the pixbufs according to some "size"
preference so images are shown smaller or bigger.
The option of filling the store each time "size" preference is changed
is not a valid solution as there a lot of rows there so it would be
very slow.
Thanks,
Iñigo Serna
[1] http://www.pygtk.org/docs/pygtk/class-gtkiconview.html
[2] http://www.pygtk.org/docs/pygtk/class-gtkcelllayout.html#method-gtkcelllayout--set-cell-data-func
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iconview.py
Type: text/x-python
Size: 1256 bytes
Desc: not available
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101121/6e3c307d/attachment.py>
More information about the pygtk
mailing list