Morph update

Ned Konz ned at bike-nomad.com
Mon Dec 2 17:20:45 UTC 2002


On Monday 02 December 2002 03:14 am, David Duke wrote:
> A question similar to one that Stefan Champailler asked around a
> week ago.  I have a morph, and I want to force its redisplay. 
> However, I want to avoid using the built-in stepping mechanism (as
> Karl Ramberg suggested in his reply to Stefan).  What I really want
> is to send a message to the morph directly, with the sender being
> blocked until the morph has actually been redrawn.  Looking through
> the protocol or "morph" didn't reveal anything obvious --- can
> anyone suggested an appropriate message, or if there is some
> indirect way of forcing an update?

You could send it #changed from within the UI Process. And it'll be 
refreshed at the next world cycle.

However, the stepping mechanism is by far the most comfortable to use.

The answer of what's best depends on your architecture. If you're 
doing this from another Process than the UI, you can use 

WorldState addDeferredUIMessage: somethingValuable

where somethingValuable is something that responds to #value in a 
useful way.

somethingValuable will be sent #value from the UI process at the next 
refresh cycle.

Another way to do something synchronously with the UI process is to 
use Morphic alarms (see the WorldState alarms protocol).

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list