Hi Tom,

> Could you please explain a bit further how you get from attributes to event 
> callbacks? Do you capture an event on the SVG area and scan all its element 
> attributes?

I am just guessing here but check out this command:

SVG Find element ID by coordinates
http://livedoc.4d.com/4Dv15.4/help/Command/en/page1054.html

The description of this command talks about using the On Clicked event of the 
object to get the mouse coordinates and then then using the X Y coordinates of 
the mouse location with the SVG Find element ID by coordinates to find out what 
is beneath the mouse during the click event.

You should then have the ID of the element that was clicked on.

If you had set a custom attribute for that element using SVG SET ATTRIBUTE you 
could then use SVG GET ATTRIBUTE to obtain that custom attribute, then, 
assuming it is a method name, you could use the EXECUTE METHOD command to 
execute it.

This is just one approach.

Another approach could be to use a case statement for the elements that you 
know may be clicked on, with each action defined within the case statements.

There could be other approaches to.

-Tim






**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to