xul, javascript and manipulating svg

Tony Cox <[email protected]> Wed, 2 Sep 2009 14:13:10 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.svg
Organization http://groups.google.com
Message-ID <b2b10e61-e853-4198-a941-0c47e35e542e__36251.7925248996$1251926152$gmane$org@t13g2000yqn.googlegroups.com>
I have been writing a xul app that displays and object graphically
using an inline SVG.

I hav ewritten the object, and a renderer that knows how to draw the
object's information. I pass both the object and the SVG (DOM object)
to the renderer - and it all works reasonably well.

I wanted to add some interactivity so that the GUI could modify the
object by clicking on the SVG etc. So I added some event listeners to
various parts of the SVG to make the changes.

Here is my problem. The SVG knows nothing about its parent object (the
renderer). So the event listeners cannot call methods on the renderer
to update itself (and hence the object it is representing). I could
call global functions from the listeners and get those to call
functions on the renderer - but that seems ugly.

So I seem to have a design flaw here. Can anybody suggest a better
design or a way toconnect the SVG listers to the parent renderer?

thanks

Tony