Re: Can different cells in a column have a different renderer?



On Thursday 30 October 2003 14:09, Eric Christianson wrote:
Is there a way in a treeview to apply a different renderer to cells in a 
column? For example:
   | Name  | Score   |
   | Name1 | Score 1 |
   | Name2 | Score 2 |

Where Score 1 has a spin cell renderer with a step of 1 and Score 2 has a
spin cell renderer of .5.

It looks like a cell renderer applies to a column, but perhaps a custom
cell renderer could be used to do it. I just want to know if it's even
possible in the current architecture, because I have an application where I
would like to be able to do that.

Well, there is no spin button cell renderer in Gtk+ so far as far as I'm 
aware, so you'd need to use a custom cell renderer for that anyway.

And if you use a custom cell renderer for that, you can of course implement a 
"step" (or whatever) property for your custom cell renderer and link that to 
a model column via attributes, so that different rows have different 
parameters. This involves a decent amount of hacking though, especially if 
you want the spin buttons to be visible at all times and not only in editing 
mode (if that is possible at all, which I'm not sure about).

Cheers
-Tim




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]