[Newbies] Why mouseDown only called for the first morph?
linuxhippy at gmail.com
Tue Oct 19 14:04:44 UTC 2010
I am new to Squeak and I try to write a tic-tac-toe like game.
I have a BorderedMorpth as board to which I add some EllipseMorphs as childs:
> for: 1 to : ...... [
> child := OwnEllipseMoph new.
> bordered addMoprh: child.
> child bounds: xPos at yPos corner: (xPos+fieldSize-5)@(yPos+fieldSize-5). ]
The result looks like the following image: http://184.108.40.206/morph.png
All the EllipseMorphs are identical and change their color at mouseDown:
> handlesMouseDown: evt
> ^ true
> mouseDown: evt
> self color: Color green.
The problem is that I only receive mouseDown on the first EllipseMorph I add.
When I click on the other EllipseMorphs nothing happens.
Any idea what the problem could be? Could it be the bound-setting
confuses Morph's event handling?
Thank you in advance, Clemens
More information about the Beginners