[pygtk] Re: THANKS a lot!!!
jdahlin at async.com.br
Thu Feb 16 20:21:07 WST 2006
> my main objective was to use mouse events to move the ellipse mainly by
> clicking and dragging the mouse on the ellipse hence moving it across
> the window in any direction(some initial code of the same is there on
> the mailing list). The only way to do the same was by refering to the
> drag and drop example in the tutorial, but that uses a pixmap rather
> than a vector drawing.
Seems like you're trying to write a canvas.
I'd recommend looking at other solutions first, there are a couple of
ongoing efforts to write a canvas on top of cairo.
You don't actually need to do drag and drop.
There's some code to handle the logic of moving windows inside windows
in some code Havoc Pennington wrote (and I extended) inside gazpacho:
Methods of interest to you are:
It handles the mouse logic for resize and move, you'd still have
to adapt/implement the actual drawing to use cairo and your data structures.
Johan Dahlin <jdahlin at async.com.br>
Async Open Source
More information about the pygtk