[Cuis-dev] batched updates
Mark Volkmann
r.mark.volkmann at gmail.com
Fri Jan 17 14:32:28 PST 2025
Thank you SO MUCH for explaining that!
Wrapping some of my code in a block and sending #fork to it works perfectly.
On Fri, Jan 17, 2025 at 11:14 AM Weslleymberg Lisboa via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:
> 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í
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
--
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250117/fb6da3b9/attachment.htm>
More information about the Cuis-dev
mailing list