changing gtkpixmap image
yoioque
yoioque at ifrance.com
Wed Jan 9 20:41:23 EST 2002
hi,
i'm trying for a long time to use the gtk_pixmap_set to change the pixmap
of a gtkpixmap widget, but i allways got the same error, i don't
understand it :-//
--------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.2/site-packages/gtk.py", line 130, in __call__
ret = apply(self.func, a)
File "<stdin>", line 15, in flip
File "/usr/lib/python2.2/site-packages/gtk.py", line 2342, in set
_gtk.gtk_pixmap_set(self._o, pixmap, mask)
TypeError: gtk_pixmap_set() argument 3 must be GdkWindow, not None
--------------------------------------
i didn't found any working example about it, so could
someone help me ?
--------------------------------------
from gtk import *
import GdkImlib
window = GtkWindow()
window.connect('destroy', mainquit)
boutton = GtkButton('flip')
vbox = GtkVBox()
window.add(vbox)
def flip(self):
image = GdkImlib.Image("00002.JPG")
image.render()
pixmap, mask = image.get_pixmap()
logo.set(pixmap, mask) # ERROR is here
logo.show()
image = GdkImlib.Image("00001.JPG")
image.render()
pixmap, mask = image.get_pixmap()
logo = GtkPixmap(pixmap, mask)
logo.show()
boutton.connect('clicked', flip)
vbox.pack_start(logo)
vbox.pack_start(boutton)
window.show_all()
mainloop()
--------------------------------------
More information about the Python-list
mailing list