in reply to Setting widget bg color in Gtk2

Its difficult to say why you have problems with the background color... please take a look at: http://ometer.com/gtk-colors.html (particularly at the section that says: Why doesn't setting the color work for me?). It's possible that you might need to create a container/eventbox. Another resourceful place (although for php - but it should be pretty straightforward to implement in perl) - you may need to register to see the entire code: http://www.kksou.com/php-gtk2/articles/set-the-background-color-of-GtkLabel.php Have fun:-)

Replies are listed 'Best First'.
Re^2: Setting widget bg color in Gtk2
by neptuneray (Sexton) on Aug 10, 2008 at 04:12 UTC
    eosbuddy,

    I just found the reason explained at:
    http://www.daa.com.au/pipermail/pygtk/2007-July/013988.html

    Note:
    modify_bg() only affects widgets that have an associated gtk.gdk.Window.

    The weird thing is that calling the modify_bg method on HBox does not throw an error.

    Thanks again,
    Ray
Re^2: Setting widget bg color in Gtk2
by neptuneray (Sexton) on Aug 10, 2008 at 03:56 UTC
    eosbuddy,

    Yes, packing the label into an EventBox and setting its bg_color worked! Thank you very much for your quick response.

    However, in re-writing the code, I think I might have found something that was screwing with my HBox color getting set right. If I find something, I'll post that solution also.

    Ray