[pygtk] Erasing/Undoing in Drawable

A.T.Hofkamp a.t.hofkamp at tue.nl
Wed Jun 18 14:58:13 WST 2008


Adiv wrote:
> Is there a way to erase or undo something that has been drawn onto a
gtk.gdk.Drawable? Or, if better, just moved to a different point in Drawable?
I know the GIMP has an eraser tool, so it's gotta be possible.

No, not as primitive.

Instead, mark the old place as 'dirty' (ie needs to be redrawn), update the 
position information of the something to the new position in your data 
structure that expos() uses, and mark the new place as 'dirty'.
Then give back control to the main-loop, which will dispatch a few expose() 
events to update your dirty areas.

Happy redrawing!
Albert



More information about the pygtk mailing list