On Wed, Dec 03, 2003 at 11:43:02PM +0100, asterix wrote:

> 1/ in my gtk.treestore, i have a "column" with a value witch can be 'g' 
> or 'u'. If it's 'g' i'd like the background color of the treeiter to be 
> blue for example, and another color if it's 'u'.

One way is the have an extra color column (as a string) in your store, then set your
background to come from this column:

cell = GtkCellRendererText()
viewcol = gtk.TreeViewColumn(title, cell, text=i, background=j)

Where i is the treestore column to take the text from and j is the treestore
column to take the color value from.

See the properties of GtkCellRendererText for the full list of attributes
you can set this way. 

You could also use a GtkTreeCellDataFunc to do this, but I haven't tried it.
There is an example in the FAQ:

http://www.async.com.br/faq/pygtk/index.py

> 2/ i'd like to define the indentation in the treeview : i'd like the 
> children of a treeiter to be under it and not shifted, is it possible ?

Perhaps the "indent-expanders" property of GtkTreeView?

> 3/ i'd like to extract a widget from a treeiter to attach a tooltip to 
> it. So is there a Hbox or something else in treeiter that can be used ?

I don't think it's possible.  Doesn't look like we'll have treeview tooltips
until gtk+ 2.6.

Dave Cook
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to