views:

157

answers:

1

Hi, I'm trying to superpose two GwtCanvas (which use an Html5 canvas). I am able to get this effect by using an absolute panel. But by doing this, I can't get my object to fill my panel. I would like to this so I can do a whiteboard in GWT. So far, I'm pretty advance but I would like to have multiple canvas overlay to support undo or preview. For example, if we draw a rectangle, it would be good to preview it as we move the mouse. I have found a javascript tutorial to do this : ex: http://dev.opera.com/articles/view/html5-canvas-painting/

There is a javascript example, but I'm not sure how to do the bridge between GWT and JavaScript. Any ideas ?

+1  A: 

I think you should go for GWT JSNI - This way you would be able to access your JS from GWT code. You can find more information about JSNI at the following location: http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html

markovuksanovic
That seems like a good solution.
Jean-Philippe Jodoin