Re: What is "is_pointer_event" in goo_canvas_get_item_at ?



Till Harbaum / Lists wrote:
Hi,

thanks to your help, my mapping application now runs with goocanvas 99% like it did with
gnomecanvas. The only difference is that goocanvas clips the entire view to the bounds which
i actually like. I still have to test run it on the n810 being my primary target and see if the performace of goocanvas is sufficient.

I discovered that i have to set is_pointer_event to TRUE so that goo_canvas_get_item_at only
returns polylines if you are actually on those lines. If i set it to FALSE polylines also are returned
if the given coordinate is within the area sourrounded by the polyline. Why is that? The
documentation also isn't very helpful:

is_pointer_event: TRUE if the "pointer-events" property of items should be used to determine which parts of the item are tested.

It seems like you understand it pretty well. pointer-events is a gobject property of all canvas items. It controls how goocanvas determines whether the pointer is "inside" a canvas item. When false, the event coordinates must only be within an object's bounding box. When true, the event coordinates must be within the object's path (it's shape). Try an experiment:

* create a goocanvas.Canvas with a goocanvas.Polyline object inside of it.
* connect to the mouse-enter and mouse-leave signals of ** the Polyline **, not the canvas:
* on mouse-enter, make set stroke_color to "orange"
* on mouse-leave, make set stroke_color to whatever color it was originally

First try it with the polyline's pointer-events property set to True. Then try it with the pointer-events property set to false, and note the difference. All pointer events are affected by this property: button-press, button-release, motion-notify, etc.

So, in some situations you want to find out what object is at (or near) arbitrary x,y coordinates. The is_pointer_event parameter controls how goocanvas should go about determining whether or not an arbitrary point is within an object. It works just like the pointer-events property.


Can anyone explain this?

Thanks so far,
  Till
_______________________________________________
Goocanvas-list mailing list
Goocanvas-list gnome org
http://mail.gnome.org/mailman/listinfo/goocanvas-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]