[Lazarus] repaint method on Darwin/Carbon

zeljko zeljko at holobit.net
Tue Feb 10 15:53:25 CET 2009


On Tuesday 10 February 2009 15:08, Brad Campbell wrote:
> G'day all,
>
> I've got an app where I'm doing some time critical serial processing. I
> have 2 callbacks in the serial code that call back to methods in the form
> to update a status bar and caption label.
>
> I used to update the label/status bar and call Application.ProcessMessages
> so they would paint, but I discovered the indeterminacy in the other GUI
> events queued would cause my serial latency to randomly blow out badly.
> I've worked around this by doing..
>
> StatusBar1.Repaint;
> Label1.Repaint;
>
> rather than Application.ProcessMessages;
>
> On Win32 and GTK2/Linux this works perfectly, but on Carbon it won't
> repaint anything until the application can service its message queue.

1. like dmitry says - Carbon/Cocoa & Qt on all platforms does not allow 
paintings outside of paint event.
2. Calling repaint is very expensive (CPU), try with YourControl.Invalidate; 
or YourControl.Update; 

zeljko



More information about the Lazarus mailing list