Re: [pygtk] [GTK3] get background color

2013-08-01 Thread Yann Leboulanger
On 08/01/2013 02:00 AM, Osmo Salomaa wrote: Here is a very simple scrpit that shows the problem. For me it prints: Gdk.Color(red=0.00, green=0.00, blue=0.00, alpha=0.00) For editable text fields, you're probably looking for the *base* color.

Re: [pygtk] [GTK3] get background color

2013-08-01 Thread Osmo Salomaa
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

Re: [pygtk] [GTK3] get background color

2013-07-31 Thread Yann Leboulanger
On 07/31/2013 07:33 PM, Timo wrote: Op 31-07-13 13:48, Yann Leboulanger schreef: On 01/29/2013 02:18 PM, Yann Leboulanger wrote: Hi, I'm trying to get the default / current background color of a textview. The code I do it: context = tv.get_style_context() color =

[pygtk] [GTK3] get background color

2013-01-29 Thread Yann Leboulanger
Hi, I'm trying to get the default / current background color of a textview. The code I do it: context = tv.get_style_context() color = context.get_background_color(Gtk.StateFlags.NORMAL) But that returns a fully transparent color (0,0,0,0) If I first set a custom color with

Re: [pygtk] [GTK3] get background color

2013-01-29 Thread Niklas Koep
Sounds like you're trying to retrieve the default colors before the widget has been realized. Consider this (mind you this uses pygtk): #!/usr/bin/env python import gtk def main(): window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect(delete-event, lambda *x: gtk.main_quit()) tv

Re: [pygtk] [GTK3] get background color

2013-01-29 Thread Yann Leboulanger
On 01/29/2013 02:35 PM, Niklas Koep wrote: Sounds like you're trying to retrieve the default colors before the widget has been realized. Consider this (mind you this uses pygtk): No, this is done AFTER the widget is realized. It's done in a textbiffer 'changed' callback, a long time (several