[pygtk] Re: Trouble getting a ListStore with dynamic column
number.
Alessandro Dentella
sandro at e-den.it
Mon Feb 4 03:58:48 WST 2008
> The solution that I use now is to put a Python class in column 0 and then
> use set_cell_data_func to access the appropriate attribute of the class
> (or other Python object) corresponding to the indicated column of the
> TreeView. This is the better solution because the GTK code is oblivious
> to the number of columns as that information has been moved into Python.
>
> There's a FAQ on how to use this feature of GTK if you are not familiar
> with it:
>
> http://faq.pygtk.org/index.py?req=show&file=faq13.029.htp
This is an interesting solution. I'm just worried about efficency and I'd
like if someone could comment on this.
As far as I remember the function is called all the time the cell becomes
visible, so that if you scroll up and down it can be called several times
for the same values. On the opposite if you have many lines/columns that
are not visible you will not call the function uselessly.
When is an advantage and when is better to set directly the value in the
model?
thanks
sandro
*:-)
More information about the pygtk
mailing list