[pygtk] change the background image in a Pygtk table that contains a layout
Petsas Athanasios
petsas at csd.uoc.gr
Wed Jan 27 23:14:55 WST 2010
Hello all,
I have created a gtk.Layout and I have attached it in a gtk.Table. What I
want to do is to put a background image in it, where the
widgets will be placed. How I can do this? I try the code below that change
the background image of the window, but this doesn't work on
the layout or the table. Can anybody help me on this?
Thank you in advance,
Thanasis
code:
import gtk
imagename = 'image.jpg'
win = gtk.Window()
pixbuf = gtk.gdk.pixbuf_new_from_file(imagename)
pixmap, mask = pixbuf.render_pixmap_and_mask()
width, height = pixmap.get_size()
del pixbuf
win.set_app_paintable(gtk.TRUE)
win.resize(width, height)
win.realize()
win.window.set_back_pixmap(pixmap, gtk.FALSE)
del pixmap
win.show()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100127/efe95b08/attachment-0001.htm
More information about the pygtk
mailing list