Please next time, provide a runnable example, it's boring to have to write the missing parts and comment what is unrelated.
Here's an example that should work. Basically, the code you provide doesn't even have the problem you say you have. The main problem of your initial sample is that you're setting a black background to your GtkDrawingArea
, instead of a blue one.
import gtk
class Test:
def main(self):
self.w = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.w.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0))
self.drawing = gtk.DrawingArea()
self.drawing.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color('#0000ff'))
self.w.add(self.drawing)
self.w.show_all()
self.w.connect("destroy", gtk.main_quit)
gtk.main()
if __name__ == '__main__':
a = Test()
a.main()