The following approaches work:

 public class SnapSvgWidget extends Widget {

    public SnapSvgWidget() {
      setElement(Document.get().createDivElement());
      drawExample(getElement());
    }

    private native void drawExample(Element container) /*-{      var paper = 
$wnd.Snap(400,400)      var circle = paper.circle(50,50,40)      // paper is 
not a DOM element. The <svg> DOM element is stored in paper.node      
container.appendChild(paper.node)    }-*/;

  }

  public class SnapSvgWidget2 extends Widget {

    public SnapSvgWidget2() {
      setElement(createSvgElement());
      drawExample(getElement());
    }

    private native void drawExample(Element container) /*-{      var paper = 
$wnd.Snap(container)      var circle = paper.circle(50,50,40)    }-*/;

    private native Element createSvgElement() /*-{      return 
$doc.createElementNS("http://www.w3.org/2000/svg";, "svg");    }-*/;

  }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to