[Cuis-dev] batched updates

Weslleymberg Lisboa weslleym.lisboa at gmail.com
Fri Jan 17 09:14:41 PST 2025


Hi, Mark

It seems your method is delaying UI updades. AFAIK our code runs on the 
UI process by default, so long-running computations will block the UI. 
You can see this by evaluating:

1 to: 10 do: [ :n |
	n print.
	(Delay forSeconds: 1) wait. ]

On Windows, my transcript updates but the rest of the UI freezes completly.

To avoid this you can start the long-running method on a new process:

[ 1 to: 10 do: [ :n |
	n print.
	(Delay forSeconds: 1) wait. ]] fork.

If you want to control when to start your computation, you can call 
#newProcess instead of #fork and save the returned process so you can 
call #resume on it later.


Em 17/01/2025 09:48, Mark Volkmann via Cuis-dev escreveu:
> I have a long-running method (a couple of seconds) that is invoked by 
> clicking a button. At the beginning of the method I want to write to the 
> Transcript and update the text in a LabelMorph. But it seems both 
> updates get batched and I don't see the results until my method finishes 
> executing. Is there a way I can "flush" those updates so they take place 
> immediately? I see that Transcript has a flush method, but sending that 
> message didn't cause the Transcript to update immediately.
> 
> -- 
> R. Mark Volkmann
> Object Computing, Inc.
> 

-- 
Wéslleymberg Lisboa
Graduado em Sistemas de Informação
Docente no IFFluminense - Campus Itaboraí



More information about the Cuis-dev mailing list