[pygtk] Changing a style property of TreeView

Aravind Vijayakumar iamfenris at yahoo.com
Thu Mar 20 04:08:06 WST 2008


HI Jeffrey,

I recently ran into something similar, I don't have the code in front of me, but I had to do something like:

gtk.rc_reset_styles(gtk.settings_get_default())

after I had done the rc_parse_string for the changes to take effect.

References:
http://www.pygtk.org/docs/pygtk/class-gtksettings.html#function-gtk--settings-get-default
http://www.pygtk.org/docs/pygtk/class-gtkrcstyle.html#function-gtk--rc-reset-styles

Hope that helps,
Aravind

----- Original Message ----
From: Jeffrey Barish <jeff_barish at earthlink.net>
To: pygtk at daa.com.au
Sent: Wednesday, March 19, 2008 6:01:16 AM
Subject: [pygtk] Changing a style property of TreeView

I would like to change the style property indent-expanders of a TreeView. 
Following the example of FAQ 4.18, I put the code:

rcstring = """
style "treeview-style" {
    GtkTreeView::indent_expanders = 0
}

class "GtkTreeView" style "treeview-style"
"""
gtk.rc_parse_string(rcstring)

at the top of the module.  I do not get an error message, but when I do

print treeview.style_get_property('indent-expanders')

at the point in the code where I create the treeview, the value is still
True.  I don't really understand the explanation in FAQ 4.18, so no doubt I
am doing something stupid.  Anyone know what?
-- 
Jeffrey Barish

_______________________________________________
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/





      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


More information about the pygtk mailing list