[cairo] Moving objects with mouse

Dov Grobgeld dov.grobgeld at gmail.com
Sun May 9 22:02:30 PDT 2010


If pixels change on the screen you have to redraw by definition. But there
are various levels of abstraction that take care of this so that you don't
have to do it manually. For the application that you describe you might be
better off using one of the canvas implementations in which you treat canvas
items as separate entitities with various properties  (e.g. position). You
can e.g. easily move these items and the goocanvas widget will trigger the
necessary redrawing for you.

Regards,
Dov

2010/5/10 João Oliveira <joao.p.oliveira at iscte.pt>

> Hi,
>
> I am quite new to gtk and cairo and I would like to ask what is the best
> way of doing the following very simple program:
>
> I want to draw 2 different rectangles in a drawing area widget (?). I want
> to be able to move them with de mouse freely in the drawing area. Is there a
> way to associate the mouse to a single rectangle? How the best (the simple)
> way of doing this?
> In the examples I saw, the objects were draw in the same widget. Is it
> possible to have different ones and simply move them in the window without
> have to redraw?
>
> So help would be very appreciate!
>
> Thanks
> João Oliveira.
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100510/85fa4cca/attachment.htm>


More information about the cairo mailing list