[Lazarus] GTK2 threading

Anton Kavalenka anton.k at tut.by
Thu Apr 4 16:22:40 CEST 2013


test application from http://bugs.freepascal.org/view.php?id=24120

Addit XInitThreads to the initialiization section of second unit after 
cthreads allows the test application start.

Funny enough that the windows approach - sending a message (message 
would be delivered in a window thread context) does not work  here.

WinaAPI approach:

InvalidateRect(Display.Handle, nil, false); // notify window regions on 
invalidation
Display.Update; // let the window process its messages

delivers LCL message in context of calling thread.

the only way - TThread.Synchronize(nil,Display.Refresh);

IMO queuing LCL message into main thread message queue can resolve lots 
of bugs.

BTW: Moving mouse over the checkbox and button sometimes display their 
text in the coloured painted rectangles.

regards,
Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130404/9462438f/attachment-0003.html>


More information about the Lazarus mailing list