[Cuis-dev] Object wantsSteps

Juan Vuletich juan at cuis.st
Mon Mar 27 06:15:22 PDT 2023


If your classes are models of a Morphic GUI, the style I prefer is to 
have the main morph receive the stepping, and call the model.

Using threads is trickier, because you'd need to protect state that is 
accessed from more than one thread. Morphic stepping is simpler to use, 
and often it is enough.

On 3/27/2023 9:51 AM, Alexandre Rousseau via Cuis-dev wrote:
> Thanks! I feel though that threads could be overkill for my needs (I'm 
> probably biased as an Elixir -- light processes etc -- dev) ?
>
> - I have a TrafficLightFSM (cycling through, say, #red #green #yellow 
> states).
> - This fsm aka model is observed by a TrafficLightMorph, a 
> WalkPrompterMorph, a CountdownMorph, and others.
> - I would like to keep the timing of transitions from one state to the 
> next inside the model.
>
> Creating/finding a TimerMorph acting as controller of my model could 
> work, but I was wondering if there was a canonical way for such needs.
>
> ps: gotta love Smalltalk ... so pleasant + easy to work with (and to 
> shoot oneself in the foot :) .
>
>
>
> On Mon, Mar 27, 2023 at 7:44 AM Hernán Wilkinson 
> <hernan.wilkinson at 10pines.com <mailto:hernan.wilkinson at 10pines.com>> 
> wrote:
>
>     Those messages are part of the Morph framework.
>     They do not work on regular objects, I do not know why they are
>     defined in Object, perhaps a legacy reason.
>     If you want to send messages at regular intervals, create a thread
>     to do it using the message #fork or similar (look at BlockClosure
>     class)
>
>     Cheers
>     Hernan.
>
>     On Mon, Mar 27, 2023 at 12:18 AM Alexandre Rousseau via Cuis-dev
>     <cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>> wrote:
>
>         I'd like my Object's subclass instances to send messages at
>         regular intervals.
>
>         I see that Object defines the #wantsSteps and #stepAt:
>         selectors, but I can't find examples of usage.
>
>         Does anyone have anything on this?
>
>         Thanks
>
>         -- 
>         Cuis-dev mailing list
>         Cuis-dev at lists.cuis.st <mailto:Cuis-dev at lists.cuis.st>
>         https://lists.cuis.st/mailman/listinfo/cuis-dev
>
>
>
>     -- 
>     *Hernán Wilkinson
>     Agile Software Development, Teaching & Coaching*
>     *Phone: +54-011*-4893-2057
>     *Twitter: @HernanWilkinson*
>     *site: http://www.10Pines.com <http://www.10pines.com/>*
>     Address: Alem 896, Floor 6, Buenos Aires, Argentina
>


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230327/f59a0b4c/attachment-0001.htm>


More information about the Cuis-dev mailing list