bspight at pacbell.net
Mon Jan 13 03:01:55 UTC 2003
When I try to create a new GoMorph, I get some strange behavior from
Squeak (latest download for WindowsME).
Here is the #initialize method:
self boardExtent = nil
ifTrue: [boardExtent _ 19 @ 19].
self winner: #NoOne;
board: ((Array new: self height * self width)
atAllPut: (Dictionary new at: #Color put: #Empty;
at: #Liberties put: Set new;
addMorph: (boardMorph _ GoBoardMorph newBoardExtent: self boardExtent).
self boardHandler: GoStoneHandler new
Everything goes fine until the last line. It is a bit unusual because it
actually sets an instance variable of a submorph. Here is that method:
"The boardHandler is actually an instance variable of the submorph,
boardMorph handler: aMorph
The problem comes, though, before this method is called. Instead of
sending the #new message to GoStoneHandler (which has no class methods
of its own, and is a subclass of EllipseMorph) Squeak sends it to
UndefinedObject. Which does not work, OC.
If I comment out the last line and Do the following, which I think
should be equivalent, everything works as intended.
gofer _ GoMorph new.
gofer boardHandler: GoStoneHandler new
Am I missing something?
More information about the Squeak-dev