Code below is untested:

public class GraphicsWidget extends Widget
{
 private static boolean injected = false;
 
 public GraphicsWidget()
 {
  if (!injected)
  {
   MyGraphics.injectSnap ();
   injected = true;
  }

  // set empty div as widget element:  
  Element  e = Document.get().*createElement("svg"); // Snap() needs a svg 
element, see docs.*
  setElement(e);
 }

 public void test () // called from Dialog Box
 {
  Element e = getElement();
  testLib(e);
 }

 private native void testLib (Element container)
 /*-{
  var s = $wnd.Snap (container); *// should work now*
  var c = s.circle (150,150,100);  
 }-*/;
}

-- 
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/groups/opt_out.

Reply via email to