When a screen is updated?

I am developing my first Raspberry Pi desktop application with Xojo and I am having some problems displaying the various windows.

I notice that when you get to the Show method of a window, instead of being seen in the foreground of the screen, it looks all black and, until you get back to the main thread, it doesn’t display correctly.

This means that there is no seamless transition between screens. There is always a moment when the screen is black.

Is there a solution for this?

Wrong channel pal.

For Desktop, I would say: “Use Window1.Refresh”, but for rpi, I do not know.

do you have a longer method running
after .show?

I have also noticed that on the Pi, when you resize a window, such as a browser window, the window resizes but the content doesn’t resize until you let go of the mouse. Not really live, in other words.

The method is calling from a Serial.DataAvailable event, that occurs continuously.

I’m going to make a suggestion here.

Instead of processing data directly in the DataAvailable event, I suggest that all you do there is write the incoming data to a buffer and trigger a timer to process the data in a thread where you can yield time back to the main thread periodically.

FWIW, this will not only help with this drawing issue, but it’ll help with reentrancy.

1 Like

Thank you for the suggestion. Maybe that is the problem.