Login Register

how to identify a dojox gfx circle?

hello!
I user dojox.gfx for drawing circles on an image.
all works fine.
but now I would like to identify which circle was selected. so I need an ID.
but the circle.rawNode doesn't have an ID and always look the same.
any advice would be great!

thanks a lot!
claudette!

When you draw the circles...

...maintain either a set of references to them, or use [shape].connect to attach the event handlers to them so that you know which shape is the one that received the event.

hey ttrenka! thanks a lot

hey ttrenka!
thanks a lot for your answer!
could you show me a small [shape].connect example?

I thought about something like this:

selectThisCircle: function(e){
this.circle = e.currentTarget;
}

this.circle is my actual circle. the above example works with "normal" html nodes. but how do I this with my gfx circle?

thank you!
claudette

Take a look at

Take a look at dojox/gfx/demos/clock.html — look for the section "attach events" near the end.

in the clock example the

in the clock example the event handling is similar to my example above:

onMouseDown = function(evt){
selected_hand = evt.target;

...
}

evt.target is the rawNode of the gfx object. I need the object.
can I somehow get the object if I only have the rawNode?

thank you!

No. You need to map it to

No. You need to map it to the shape object yourself.