When are the deferred UI messages processed ?

Ned Konz ned at squeakland.org
Wed Dec 8 05:26:44 UTC 2004


On Tuesday 07 December 2004 6:58 am, Joseph Frippiat wrote:
> I use the method logDirection:andBytes: from the changeset RCX.1.cs .
> This method uses WorldState addDeferredUIMessage:
>
>  WorldState addDeferredUIMessage: [
>  Transcript nextPutAll: dir;
>   nextPutAll: string size printString;
>   nextPutAll: ' bytes: '.
>   string do: [ :ch | Transcript
>    nextPutAll: (Character value: ch) hex;
>    space ].
>   Transcript cr; flush
>  ]
>
> "Before", it was working, and now it isn't : nothing appears on the
> Transcript.

Have you tried #endEntry instead of #flush?

> When are the deferred UI messages processed ?

In the middle of the Morphic event loop, just after responding to events, and 
before doing other step methods and displaying the world.

Look for implementors of #addDeferredUIMessage:, look at the one in 
WorldState, look for senders of #deferredUIMessages, and you'll see 
WorldState>>runStepMethodsIn: which empties the queue.

And it's called from doOneCycleNowFor: which is  the body of the main Morphic 
event loop.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list