Curious behavior
Bill Spight
bspight at pacbell.net
Mon Jan 13 15:46:27 UTC 2003
Dear Ned,
> > 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)
>
> That sounds a bit peculiar. I usually think of things called Handlers
> as being non-GUI elements (i.e. models). But I don't know your
> design.
FWIW, here is my idea. All mouse or keyboard events on the GoBoard send
a message to the GoBoard handler (instance variable). Anything that
wants to use the board puts something there. A GoStoneHandler is a Morph
that goes there for putting stones on the board and taking them off.
When it receives a message about an event, it sends a message to its
owner, which decides what to do with the information. The owner is more
like a model. The owner may also send instructions to GoStoneHandler.
GoStoneHandler has a visual aspect, which is a large go stone (Ellipse)
indicating what color stone it is handling. The user can click it to
toggle the color to handle.
Best regards,
Bill
More information about the Squeak-dev
mailing list
|