[Pharo-users] Can't <BlSpace> addChild: <BlSpartaMozCanvasBuilder>

Tudor Girba tudor at tudorgirba.com
Mon Feb 25 12:44:53 EST 2019


Hi,

addChild: expects a BlElement not a canvas. A BlElement draws on a canvas object that is passed to it.

SpartaCanvas is an abstract class. If you want to instantiate a canvas, pick one of the subclasses.

For example, for MozCanvas, see MozExamples.

Cheers,
Tudor



> On Feb 25, 2019, at 4:55 PM, David Richards <david.i.richards.iii at gmail.com> wrote:
> 
> | canvas space node text |
> 
> . BlUniverse reset
> 
> . space := BlSpace new
> . space show
> . space title: 'Test Space'
> . space extent: 800 at 400
> . space root background: Color lightBlue 
> . space position: 1 at 25
>  
> . canvas := BlSpartaMozCanvasBuilder extent: 400 at 250
> 
> . space root addChild: canvas
> 
> This fails.
> 
> Any ideas how to create a Sparta Canvas, to draw some text on?
> 
> 

--
www.feenk.com

"There are no old things, there are only old ways of looking at them."








More information about the Pharo-users mailing list