SASE for Squeak

Hilaire Fernandes hilaire at ext.cri74.org
Wed Dec 14 14:08:57 UTC 2005


Romain Robbes a écrit :
> 
> I think you can to that in morphic already  (you can send  
> #when:send:to: to morphs).
> 
> Drilling down further, this is implemented in Object.


Oh, Great! It really looks like a SASE implementation.
I guess it could be helpfull (it would have been for me) to add a small 
note on the wiki.

A template for such a note follow, so someone with edit right can add it 
in the wiki (please fix if wrong)

---8<---
SASE pattern in Squeak

{{About SASE}}
http://members.aol.com/kgb1001001/Articles/SASE/sase2.htm

{{Squeak implementation}}
To register an event:

View>>initialize
    ...
    model when: #accept send: #go:#with to: self

View>>go: aDirection with: anObject
...

To release from an event:

View>>release
    model removeActionsWithReceiver: self
     "or: model removeActionsWithReceiver: self forEvent: #accept"


To trigger an event:

Model>>doSomething
    self triggerEvent: #accept withArguments: {self north . self}
---8<---

-- 
ADD R0,R1,R2,LSL #2



More information about the Squeak-dev mailing list