Drawing a basic shape from within Amber

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Drawing a basic shape from within Amber

Rodo
Hi group,

I'm trying to draw a simple rectangle from within Amber, but haven't succeeded so far. 

This is what I do:

          MyWidget>>renderOn: html

          canvas := html canvas.
         canvas 
         id: 'drawingBoard';
         width: '400';
         height: '400'. 

         graphicsContext := (document getElementById: 'drawingBoard')  getContext: '2d'.
         graphicsContext strokeRect: #(25 25 100 100).

Any ideas what I'm doing wrong?

Regards,

RD