Hi,
In javascript, I'm making an SVG shape and adding a click handler to it like this:
var rect = document.createElementNS('http://www.w3.org/2000/svg','rect');
rect.addEventListener('click', myClickHandler, false);
it works great. I'm trying to make an overlay Rect class in GWT. If possible, I'd like to simply do something like this:
public class SVGRect extends JavaScriptObject {
public native void addClickHandler(ClickHandler handler) /*-{
addEventListener('click', handler, false);
}-*/;
}
this way I can pass a 'normal' GWT handler to this class, and use it from the outside as any other normal GWT UI element. I'm not sure how to hook up the ClickHandler object to the native javascript implementation of the object though?
Thanks