Help with morph and world refresh
ducasse at iam.unibe.ch
Sat Apr 5 17:47:17 UTC 2003
> If these are done as part of the same World cycle, then you won't see
> the display update until after the last one. You could do something
> like forcing the changes to the screen in between, but there are
> probably better ways to do it.
> You could try adding this for testing, at least:
> Display forceToScreen: myMorph bounds; forceDisplayUpdate
> This will force any invalidated regions to be redrawn visibly.
>>>> the bot misses to pick some diamonds: really annoying. I guess
>>>> that this is because the method can pick and pick do not contain
>>>> World doOneCycle.
> Does it really miss doing something, or just not show that it is doing
It really misses it. which means that
>> Nathanael already did that for the turtle with animation that I
>> have. But this is really complex.
>> I'm amazed to see how difficult it is to simply do a stupid small
>> in Squeak that requires animation (ok I do not use step).
> Animation when combined with a display that caches changes requires
> some kind of synchronization.
I learned it :) but I'm always trapped.
We did different animation for the turtle with nathanael and even him
sometimes in trouble (and he excellent in concurrent programming).
>> Still. I'm not sure that I can really develop your solution but
> thanks for
>> suggesting it. When I read it, I'm really frustrated by my lack of
> concurrent programming skills.
> Concurrent programming isn't easy in general. One of the nice things
> about the eToy system (though it certainly has a number of
> limitations) is that it presents concurrent programming in a fashion
> that is easy to get right (no explicit synchronization).
> In Morphic, there's a simplifying assumption that everything is
> happening in a single Process.
> This is the reason that most of the time step is the best choice, if
> you can use it. The display is forced to the screen at the end of
> every world cycle.
I did a complete small break out based on step and this was really
>> Would the WorldState>>addDeferredUIMessage: solve my problem?
> Not necessarily, as these messages are processed at the beginning of
> the World's update cycle. If there are multiple messages which each
> will move your Morph you won't see the intermediate position.
> Ned Konz
> GPG key ID: BEEA7EFE
Prof. Dr. Stéphane DUCASSE
"if you knew today was your last day on earth, what would you do
different? ... especially if,
by doing something different, today might not be your last day on
"The best way to predict the future is to invent it..." Alan Kay.
Open Source Smalltalks: http://www.squeak.org,
Free books for Universities at
Free Online Book at
More information about the Squeak-dev