gtk drawing set background image
I have a drawing area, and an 'png' image I want to load that image to my drawing area as background.
the screen is bigger then my image and the problem is it does not 'tile' my image
I have tried adding image as 开发者_如何学Gopixbuf and pixmap but it doesnot help
i use this line
gc.set_tile(pixmap)
area.window.draw_drawable(gc, pimap, .....)
but it does not help
i found the answer i put the code here for others
area=gtk.Drawingarea()
pixbuf=gtk.gdk.pixbuf_new_from_file('background.png')
pixmap, mask=pixbuf.render_pixmap_and_mask()
area.window.set_back_pixmap(pixmap, False)
精彩评论