Hi,
It's necessary for a program I am writing to produce snapshots of the
contents of one of its windows. I'm experimenting with the scribble.py
source, and have added a button that should copy the contents of the
main window (button included) to a new window. This should be performed
by the following method, triggered when the button is pressed. It
currently produces an X error ('BadMatch (invalid parameter
attributes)'. It seems that the mask is at fault, but is necessary
because the pygtk set_from_image method won't accept a NULL second
argument. Any ideas? I haven't seen this problem addressed before.
Many thanks,
Mark.
def shot_event(widget):
width,height=widget.window.get_size()
mask = gtk.gdk.Pixmap(widget.window, width, height)
mask.draw_rectangle(widget.get_style().white_gc, gtk.TRUE, 0, 0, width,
height)
image=gtk.Image()
image.set_from_image(widget.window.get_image(0,0,width,height),mask)
shot_win=gtk.Window()
shot_win.add(image)
shot_win.show_all()
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/