[pygtk] How to get default colours in Gtk 3?
John Stowers
john.stowers.lists at gmail.com
Tue Mar 22 17:15:24 WST 2011
On Tue, 2011-03-22 at 19:29 +1300, Greg Ewing wrote:
> With Gtk 2 I was using the following technique to find out
> the default foreground and background colours for a selection:
>
> from gtk import Style
> s = Style()
> foreground = s.fg[3]
> background = s.bg[3]
>
> However, with Gtk 3 via gi, s.fg is coming up as an empty
> list.
>
> Can anyone suggest an alternative way of going about this?
In Gtk-3 GtkStyle was replaced with GtkStyleContext
http://library.gnome.org/devel/gtk/stable/GtkStyle.html
But AFAIR some compatibility was retained, so I thought this should have
worked....
I do remember something like this in past requiring the widget to first
be realized/shown before the style information was available
John
>
> Thanks,
> Greg
>
>
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
More information about the pygtk
mailing list