[Lazarus] GTK2 paint event

José Mejuto joshyfun at gmail.com
Wed Dec 8 18:47:09 CET 2010

Hello José,

Wednesday, December 8, 2010, 6:32:39 PM, you wrote:

JM> The gecko browser is using a GTK Window which is a TCustomControl,
JM> once put in the form and started it does nothing unless the mouse is
JM> moved over the form (not need to move over the control), so it looks
JM> like a non processed message. After some tests I had decided to add a
JM> timer to the form and in the event handler add
JM> "Application.ProcessMessages" and now the window is rendered as
JM> expected :-?

This problem is resolved using "-dUSE_GTK_MAIN_OLD_ITERATION" so it
looks like some kind of "regression" (I had not tested with 0.9.28).

JM> So for me it looks like the message filter in GTK2 is not being fired
JM> with external paints.
JM> Now a second problem with maybe same roots, once the control is
JM> painted thanks to the Application.ProcessMessages every 100 ms if I
JM> resize the window the control receives the paint message but the
JM> painted content is not displayed unless I manually raise some kind of
JM> form change like a caption change, so now my Paint handler looks like:
JM> procedure TCustomGecko.Paint;
JM> begin
JM>   GeckoWindow.Paint(true); //force paint
JM>   Self.Parent.Caption:=floattostr(now); //forces a form caption change
JM> end;

This one is still present.

Best regards,

More information about the Lazarus mailing list