On 03/17/2013 09:05 AM, Ludo Brands wrote:
you create a string for the GUI, synchronize to update the screen, call Application.Processmessages to make sure the GUI gets updated.
I would suggest to do those GUI updates by QueueAsyncCall() or TThread.Queue() (TThread.Queue uses the same syntax as Synchronize and thus is rather easy to use in your case (beware of string references, though), but it might be present only in the svn version of fpc as it is rather new (because it has been existing but not documented in Delphi until rather recently. )

TThread.Queue works like TThread.Synchronize, but does not stall the thread until the mainthread has done the requested action. Thus, if no result is to be reported back or mutual access problems are lurking, it is is a lot better than Synchronize: The thread keeps running and no performance-eating ProcessMessages is necessary.

QueueAsyncCall does the same, is more versatile but uses different Syntax and is not available in Delphi.

( PostMessage / procedure ... message does the same, is available and documented in Delphi, but uses very ugly fake-Windows syntax, even if used in Linux. )

-Michael
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to