[pygtk] gtk.Style has no properties

Neil Muller drnlmuller+gtk at gmail.com
Tue Jun 30 21:27:30 WST 2009


On 6/30/09, Noam Yorav-Raphael <noamraph at gmail.com> wrote:
> Hello,
>
>  for gtk.Style objects there are no properties - I do:
>  >>> st = gtk.Style()
>  >>> gobject.list_properties(st)
>  ()
>
>  I would like to change its bg property (appears in the documentation,
>  and even in gtk-base-types.def), so that the selection color will be
>  different from the default, but since it has no properties, I can't do
>  that.
>
>  Do you know what's wrong?

These show up as attributes, not properties - try dir(st) instead.

However, poking the style directly can get tricky. I think you'll find
playing with the modify_bg and modify_base methods on the widgets a
lot less trouble.

Note that gtk.TreeView's use the base color (not bg) for the part
containing the cell renderers, so, if you want to change the selection
colour there, use modify_base.

-- 
Neil Muller
drnlmuller at gmail.com

I've got a gmail account. Why haven't I become cool?


More information about the pygtk mailing list