I have recently started using glade, python gtk+ and cairo to build GUI apps. I have constructed a DrawingArea widget in which I have used pixbuf to paint an image. However when i try to draw shapes on the image, the shapes get drawn behind the image.
def on_draw(self, wid, cr):
#cr.rectangle(1500, 300, 400, 800)
#cr.stroke()
self.pb = GdkPixbuf.Pixbuf.new_from_file_at_scale("image2.jpg", 1920, 1080, True)
Gdk.cairo_set_source_pixbuf(cr, self.pb, 0, 0)
cr.paint()
Is there any way possible to get the shapes on top of the image?
Sorry for such a silly question. I am just new to this.