I am trying to make a GTK application in python where I can just draw a loaded image on the screen where I click on it. The way I'm trying to do this is to load the image into a pixbuf file, and then draw that pixbuf on the drawing area.
The main line of code is here:
def drawing_refresh(self, widget, event): #clear the screen widget.window.draw_rectangle(widget.get_style().white_gc, True, 0, 0, 400, 400) for n in self.nodes: widget.window.draw_pixbuf(widget.get_style().fg_gc[gtk.STATE_NORMAL], self.node_image, 0, 0, 0, 0)
This should just draw pixbuf on the image in the upper left corner, but nothing is displayed except for the white image. I tested that pixbuf loads by putting it in a gtk image. What am I doing wrong here?
Michael
source share