Re: [pygtk] [GTK3] get background color
01.08.2013 10:09, Yann Leboulanger wrote: On 08/01/2013 02:00 AM, Osmo Salomaa wrote: style.lookup_color("theme_base_color") returns a 0, 0, 0, 0 color here. OK, so that's theme-specific. Some color names might be available regardless of theme, but I don't know which ones; for example Gtk.InfoBar documentation explicitly mentions {info,warning,question,other}_{bg,fg}_color. I get the same (0,0,0,0) from get_background_color with your test script. I've ran into this issue before and I have just used those Adwaita names and a not-well-thought-out fallback if the lookup fails. Curiously, if I swap the text view in your script for an entry, I get the actual background color (white). In any reasonable theme, these should probably both use the "base" color. -- Osmo Salomaa ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] [GTK3] get background color
On 08/01/2013 02:00 AM, Osmo Salomaa wrote: Here is a very simple scrpit that shows the problem. For me it prints: For editable text fields, you're probably looking for the *base* color. style.lookup_color("theme_base_color") For Adwaita, you can find the available color names in gtk-main.css [1], but I really don't know if they work across different themes. [1] https://git.gnome.org/browse/gnome-themes-standard/tree/themes/Adwaita/gtk-3.0/gtk-main.css I am under XFCE / GTK2 theme, so there is no such file in my theme. My gtkrc file has a base[NORMAL] = "#ff" line, but I don't know how to get that with gtk3. It should be possible as it's correctly rendered. style.lookup_color("theme_base_color") returns a 0, 0, 0, 0 color here. -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/