Thx for your answer !

David M. Cook wrote:

> 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)



it works perfectly, thx !


>
> 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?



it seems that this property is READONLY in gtk+2.2.4 :


  gtk_widget_class_install_style_property (widget_class,
                  g_param_spec_boolean ("indent_expanders",
                         _("Indent Expanders"),
                         _("Make the expanders indented"),
                         TRUE,
                         G_PARAM_READABLE));

and it seems not to be usable from pygtk :

>>> import gtk
>>> t = gtk.TreeView()
>>> print t.get_property("indent-expanders")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: the object does not support the given parameter

>
>
>> 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.
>


ok :(

> Dave Cook


Asterix


_______________________________________________
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