[pygtk] Simplifying what's stored in a ListStore (was Re: Inconsistent format for "path" in TreeView callbacks)

Christian Becke chris at weddingnet.homelinux.org
Sat May 7 14:36:41 WST 2011


Am 07.05.2011 06:39, schrieb Jason Heeris:
> On 7 May 2011 03:24, Neil Muller<drnlmuller+gtk at gmail.com>  wrote:
>> On 6 May 2011 21:07, Jason Heeris<jason.heeris at gmail.com>  wrote:
>> Storing the object in a hidden column is fine, and what I assumed you
>> were doing originally.
>
> Hah! Okay then, now that it's morning, I can't believe that didn't
> occur to me :P
>
> While we're on the topic though, it strikes me as more sensible to
> simply put the objects themselves in a ListStore without manually
> extracting the information for the other columns (ie. so the ListStore
> just contains one column, which is displayed in different ways). Is
> there a way to tell each TreeViewColumn to, say, "look at column zero,
> take the x.fit.param_A attribute, format it using "0x%03X and display
> it in a CellRendererText" — and then so on for each attribute, each
> describing to a different view of the same column?

Have a look at gtk.TreeViewColumn.set_cell_data_func:
http://faq.pygtk.org/index.py?req=show&file=faq13.024.htp

>
> Cheers,
> Jason
> _______________________________________________
> 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