title: How do I wrap a callback using JavaScript Overlay types (GWT)?
body: <p>In the <a href="http://easeljs.com/docs/DisplayObject.html">Display Object</a> class, I have everything wrapped excepted the events. I can't not figure out the pattern and really need an example.</p>
  
  <p>In JavaScript, you create a callback for the object like this:</p>
  
  <pre><code>displayObject.onPress = function(event) {
      $wnd.alert("object pressed");
  }
  </code></pre>
  
  <p>I have wrapped the <a href="http://easeljs.com/docs/MouseEvent.html">Mouse Event</a> parameter:</p>
  
  <pre><code>public class MouseEventImpl extends JavaScriptObject {
      protected MouseEventImpl() {}
  
      public static native MouseEventImpl create(String type, int stageX, int stageY, DisplayObjectImpl target, JavaScriptObject nativeEvent) /*-{
          return new $wnd.MouseEvent(type, stageX, stageY, target, nativeEvent);
      }-*/;
  
      ...other methods excluded...
  }
  
  public class MouseEvent {
      private MouseEventImpl impl;
  
      public MouseEvent(String type, int stageX, int stageY, DisplayObject target, JavaScriptObject nativeEvent) {
          this.impl = MouseEventImpl.create(type, stageX, stageY, target.getOverlay(), nativeEvent);
      }
  
      ...other methods excluded...
  }
  </code></pre>
  
  <p>The display object uses the same overlay pattern. How am I able to write a callback in java and pass it through to the JSO? Please provide an example if you can. :)</p>