I am trying to set the background color for a pyGtk window which has a single DrawingArea widget. With this code I always get a random color everytime I launch the script:
widget = gtk.DrawingArea()
widget.show()
window = gtk.Window()
window.add(widget)
col = gtk.gdk.Color('#010')
window.present()
widget.window.set_background(col)
window.connect('delete-event', gtk.main_quit)
gtk.main()
I also tried using widget.modify_bg(gtk.STATE_NORMAL, col)
instead of the set_background
line, and I always get a black background.
What am I missing?