Canvas Doesn't Refresh/Invalidate

I have been developing an app which analyses a stream of data in blocks. For each block of data there are a bunch of calculations with drawing several graphs directly on corresponding canvases. The calculations and redrawing of the canvas graphs are sequential within the block analysis. The purpose is to be able to watch the graphs change with each block of new data. The blocks are read from disk in a Do Loop, and the graphs each are redrawn each time. In the past Canvas.Refresh worked fine and the updating worked very well.
I am now running XOJO 2019r3 and Catalina 10.15.4 and the only update to the graphs (and some text items) occurs when the loop is over. The rotating color ball displays during the loop time with no window updates.
Can anyone help or advise? I understand there may be some issues with new versions of Xojo and Catalina, but I am just a long time user (and devotee) to XOJO and I am stuck. Thanks.

yeah a single loop that doesnt give the UI time to actually DO the redraw will show this behaviour

you end up with a single coalesced redraw at the end

you will need to split things out
a timer might work and in each timer.action you read the next chunk of data and update the graph
and that should allow the graphs to update each time you draw one frame - and you can easily control the rate by altering the period of the timer
I’m sure there are other approaches that would work

Thanks, Norman. I had considered this possibility, but did not investigate fully. Your suggestion is right, I believe, and I will do some surgery to implement it.

Pop the loop in a thread. Have the thread update a picture instead of a canvas. On a timer on the window, refresh the canvas which paints the picture if its changed or on notification from the new thread.userinterfaceupdate. As its in a thread it will yield to the UI on loop boundaries when its needs to so the UI should remain snappy if the loop happens often enough.

Thanks Julian. I will work on moving the contents of my data block analysis into a thread as you suggest.
Old time programming habits fade slowly: Besides adding the thread, I will have to convert my graphs from painting on the canvas to painting on a picture and then transferring the picture to the canvas. Furthermore, in my simple thinking I have multiple canvasses for multiple graphs to be updated each data block. The forum elsewhere suggests using one canvas with areas reserved for each graph and updating rectangles for each graph within the one canvas.

This is major rewrite and I will go quiet for a while. But with gratitude. Any further advice will be welcome. Thanks again.

Sorry for the delay Stephen, I don’t know if you know, but when moving from a paint even to a picture buffered system you can simply move the code from the paint event and into a method where you dim g as as graphics and point the picture’s graphics property to the g variable there by making all your existing code work as it did before. Best of luck with the code change.

Long delay on my part. After restructuring my code around a timer as you suggested, Julian, it has finally worked as wanted. I am most grateful for your advice.
I transferred the canvas paint code, suitably modified, into the picture graphics, but not as elegantly as you just suggested. However, only 3 x 6 lines required changes, and it was mostly cut and paste.
FYI, I had not fully understand a thread until this time, as I grew up on Fortran 2 -4 (1963!) when things were procedural and slow. My next chapter 2.5 decades later was to fall in love with LabView, and virtual instruments. My current project the first (of many) xojo/realb apps that I have written which had time-critical calculations and graphics. Be Safe.