[cairo] Draggable Circles

Gerdus van Zyl gerdusvanzyl at gmail.com
Fri Oct 31 00:35:52 PDT 2008


You need a scenegraph, there are many cairo based ones available for GTK.
Otherwise you will have to make your own by storing the shapes as objects
and handling and testing for mouse events. This is not something cairo
provides. To test for a point in cairo you can use cairo_in_fill and
cairo_in_stroke but in my own code I just use bounding boxes. Depending on
your requirements first check out the existing gtk scenegraphs/canvas
projects (http://live.gnome.org/ProjectRidley/CanvasOverview)  or even
custom GTK widgets before going it alone.

~Gerdus

On Fri, Oct 31, 2008 at 2:16 AM, Gabriel Raineri <
gabriel_raineri at yahoo.com.ar> wrote:

> Hi all!
>
> I'm using Gtkmm and Cairo.
> My idea is to draw a bunch of circles in a Gtk::DrawingArea and make them
> draggable but I don't know how to do this.
>
> Any help will be really appreciated.
>
> Thanks a lot in advance!
>
> Cheers,
> Gabe
>
> ------------------------------
>
> Yahoo! Cocina
> Recetas prácticas y comida saludable
> Visitá http://ar.mujer.yahoo.com/cocina/
>
> _______________________________________________
> 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/20081031/83b1db88/attachment.html 


More information about the cairo mailing list