[pygtk] Differents CellRendererS on the same column

Milosz Derezynski internalerror at gmail.com
Sat Sep 20 02:39:40 WST 2008


Hello José,

You can pack multiple cellrenderers into one column using
gtk.TreeViewColumn.pack_start(), and you can set a cell_data_func with
gtk.TreeViewColumn.set_cell_data_func().

In the celldata function you can then either show or hide a renderer, and
set the data which it displays (to understand this better it's probably good
to understand that essentially, when you don't set an own celldata function,
TreeViewColumn will use an internal one using parameters you specify with
gtk.TreeViewColumn.add_attribute(s)).

You can ask again if anything is unclear :)

Regards,
M.

2008/9/19 José Luis <josel.segura at gmail.com>

> Hi people!
>
> This is my first message on the list.
>
> I need to do a Tree View a little extrange: it only have 2 columns: the
> left one will always be a string, and I can use CellRendererText for all the
> rows. My problem is with the right column: I need a different renderer on
> each row, for example:
>
> In one row I would have a integer and I need a CellRendererSpin (for
> example), or I would have a list of possible elements and I could use a
> CellRendererCombo...
>
> It would be possible? I think I can use CellRenderer and its method
> "render", but I have no idea how to use it.
>
> P.S. Excuse me for my bad English and thanks for all
>
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
>


-- 
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080919/ac0c69d4/attachment.htm 


More information about the pygtk mailing list