no background yet..
authorKristoffer Grönlund <kristoffer.gronlund@purplescout.se>
Tue, 5 Jan 2010 16:38:25 +0000 (17:38 +0100)
committerKristoffer Grönlund <kristoffer.gronlund@purplescout.se>
Wed, 6 Jan 2010 13:56:42 +0000 (14:56 +0100)
helldon/__init__.py

index cf817d7..c333823 100644 (file)
@@ -15,6 +15,7 @@ class Program(gtk.Window):
 
     def __init__(self):
         gtk.Window.__init__(self, type=gtk.WINDOW_TOPLEVEL)
 
     def __init__(self):
         gtk.Window.__init__(self, type=gtk.WINDOW_TOPLEVEL)
+        self.set_app_paintable(True)
         self._vbox = gtk.VBox()
         self._title = gtk.Label("Jamaendo")
         self._backbtn = gtk.Button("<<<")
         self._vbox = gtk.VBox()
         self._title = gtk.Label("Jamaendo")
         self._backbtn = gtk.Button("<<<")
@@ -31,6 +32,14 @@ class Program(gtk.Window):
         Program.instance = self
         self._backbtn.connect('clicked', self.on_back)
 
         Program.instance = self
         self._backbtn.connect('clicked', self.on_back)
 
+        bgimg = 'data/bg.png'
+        if bgimg:
+            background, mask = gtk.gdk.pixbuf_new_from_file(bgimg).render_pixmap_and_mask()
+            self.set_app_paintable(True)
+            self.realize()
+            self.window.set_back_pixmap(background, False)
+            self.window.clear()
+
         self._stack = []
 
     def add_window(self, wnd):
         self._stack = []
 
     def add_window(self, wnd):