[squeak-dev] Morphs and Data Question

K K Subbu kksubbu.ml at gmail.com
Mon Oct 26 10:12:25 UTC 2020


On 25/10/20 8:14 pm, Eric Gade wrote:
> For example, if I have some data related model with text that updates 
> and I want the "view" (the Morph) to update whenever this occurs? In my 
> own quick code I've always just implemented a `step` method that checks 
> for data on the model updates, but is that too brutal and inefficient?
It depends. Stepping is for periodic sampling. If you have fast changing 
variables but a view is required, say, only once every 100ms, then 
stepping is fine.

But if the changes are slow and asynchronous (say from radio buttons) 
then an observer pattern explained by Trygve is a better choice.

HTH .. Subbu


More information about the Squeak-dev mailing list