[pygtk] How to use GtkStyleContext?

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Mar 23 14:22:36 WST 2011


Are there any examples of using gi to access a GtkStyleContext?
I'm completely failing to get anything useful out of it.

 >>> w = Gtk.Window.new(Gtk.WindowType.TOPLEVEL)
 >>> w.set_visible(True)
 >>> s = w.get_style_context()
 >>> s.get_property("cursor-color", Gtk.StateFlags.SELECTED)

(.:378): Gtk-WARNING **: Style property "cursor-color" is not registered

Since "cursor-color" is listed as a style property for the
Widget class, I would have expected all widgets to have it.

-- 
Greg


More information about the pygtk mailing list