[Cuis] #when:send:to:

Dan Norton dnorton at mindspring.com
Sun Nov 15 12:47:00 CST 2015


On 13 Nov 2015 at 18:33, KenD wrote:

> On Fri, 13 Nov 2015 12:58:22 -0500
> "Dan Norton" <dnorton at mindspring.com> wrote:
> 
> > Hello Everyone,
> > 
> > The following repo contains before and after examples of replacing
> the Dependency 
> > Mechanism with the Observer Pattern:
> > 
> > 	https://github.com/dhnorton/Cuis-Smalltalk-light
> > 
> > Please take a look at this and tell me what needs to change.
> 
> Dan,
> 
> Good start.
> 
> I would suggest a deeper example.
> 

Hmm, I made it stark simple in order to focus on the basics. However, a couple of 
possibilities could be: a 3-bulb traffic light with a change button (incremental add-on), or a 
drag race tree (elaborate).

 - Dan

> Lights could be a model with a presenter (LightPanel) which shows
> the lights.  E.g. open a layout morph with a row of elipses
> (circles) which are red/green (or whatever) for off/on.
> 
> Clicking on a light changes the model (Lights subclass ActiveModel),
> which signals 
>   triggerEvent: #colorChange with: aColor.
> 
> You can look in Morphic-Misc1 at RadioButtonMorph to see how to
> handle clicks.
> 
> Workspace code could also turn off/on or just toggle lights in the
> model, with the LightPanel presenter updating appropriately.
> 
> One can then add a bit of wackyness, like using different colors
> than red/green and the presenter will show the proper color..
> 
> $0.02.
> -KenD 
> 
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org






More information about the Cuis mailing list