My first morph

Bert Freudenberg bert at
Mon Nov 7 21:44:12 UTC 2005

Look into class PianoKeyboardMorph, specifically #buildKeyboard. It  
builds each key as a separate Morph and uses #on:send:to:withValue:  
to wire events.

- Bert -

Am 07.11.2005 um 22:18 schrieb Bob.Cowdery at

> Now I need to know how to do user defined events such
> that when a digit overflows or underflows the next digit in line  
> receives an
> event and can increment or decrement itself. The event can go  
> direct or
> probably more sensible to send it to the parent which is my top level
> display class not the alignment morph. Any hints appreciated.
> Chris Muller wrote:
> > I don't know whether I correctly understand what you are trying  
> to do, but one
> > suggestion would be to maintain a pure domain (the single number)  
> and just let
> > the UI display each digit..
> Ok, but the reason I have a separate Morph for each digit is that  
> it makes the mouse interaction a lot easier to do as I mouse over  
> each morph, highlight it and let it capture the wheel/keystrokes.  
> The parent will have the single domain number and can load the  
> digits initially and be informed when one changes. What I am after  
> is understanding the morphic event system or perhaps just an event  
> system. Not from the point of view of events generated from the  
> mouse, keyboard etc but in code when I decide there is something  
> another object might need to know about. At the moment I give the  
> object a block to execute which is really little more than a  
> callback to execute when a certain condition is met, so an empty  
> block evaluates to nil and nothing happens. This is the wrong way  
> to do it and I want to make it a pure event system. The sender of  
> the event should not be concerned who the receivers are or even if  
> there are any receivers.
> It's easy enough to code up a notifier class such that senders just  
> send their named events to a notifier instance and event listeners  
> register their interest in named events and then receive those  
> events. At least it's easy in languages I know, I am still  
> struggling a bit with the syntax and class library. I simply  
> thought that there must be a class that does that somewhere.
> Bob
> *** Confidentiality Notice *** Proprietary/Confidential
> Information belonging to CGI Group Inc. and its affiliates
> may be contained in this message. If you are not a recipient
> indicated or intended in this message (or responsible for
> delivery of this message to such person), or you think for
> any reason that this message may have been addressed to you
> in error, you may not use or copy or deliver this message
> to anyone else.  In such case, you should destroy this
> message and are asked to notify the sender by reply email.

More information about the Squeak-dev mailing list