Hi Gary,
On Tue, 2005-02-01 at 20:45 -0500, Gary Jaffe wrote:
> ebox = gtk.EventBox()
> bgColor = ebox.get_style().copy().bg[gtk.STATE_NORMAL]
>
> If I immediately follow this with
>
> ebox.modify_bg(gtk.STATE_NORMAL, bgColor)
Perhaps you need to realize the ebox before getting the style. I've
found that the style is the default one, not the theme one, until you
realize a widget. You can see this clearly if you toy around in a prompt
like ipython:
In [1]: import gtk
In [2]: w = gtk.Window()
In [3]: w.get_style()
Out[3]: <gtk.Style object (GtkStyle) at 0xb70d6784>
In [4]: w.realize()
In [5]: w.get_style()
Out[5]: <__main__.IndustrialStyle object (IndustrialStyle) at 0xb70d6c34>
Also useful might be this debugging proc:
def pc(c):
return '#%02x%02x%02x' % (c.red>>8, c.green>>8, c.blue>>8)
Cheers,
--
Andy Wingo
http://wingolog.org/
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/