[pygtk] gtk.Widget.modify_bg and gtk.Label

John Sigurdson johns at ilm.com
Fri Jan 27 02:53:32 WST 2006


Hi,

I'm trying to change the background of a gtk.Label.  The docs state the 
following:

modify_bg() only affects widgets that have an associated gtk.gdk.Window 
<http://www.pygtk.org/pygtk2reference/class-gdkwindow.html>. Widgets 
that do not have an associated window include ... gtk.Label 
<http://www.pygtk.org/pygtk2reference/class-gtklabel.html> ... These 
widgets can be added to a gtk.EventBox 
<http://www.pygtk.org/pygtk2reference/class-gtkeventbox.html> to 
overcome this limitation.

So... I make my Label a child of an EventBox and then use modify_bg on 
the Label.  It doesn't work.  I tried it on the EventBox too, just to be 
sure.  No luck.  What am I missing here?

Thanks,
John


More information about the pygtk mailing list