Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
When are the deferred UI messages processed?
Last updated at 10:11 pm UTC on 25 August 2016
Joseph Frippiat December 07, 2004 When are the deferred UI messages processed? I use the method logDirection:andBytes: from the changeset RCX.1.cs . This method uses When are the deferred UI messages processed?


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. When are the deferred UI messages processed?

Answer:

Have you tried #endEntry instead of #flush?

Deferred UI messages are 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.

Comment:

Joseph Frippiat
endEntry 
... like in QHsmTestSM>>dispatch: of course!