[Lazarus] GTK2 EraseBackgound

zeljko zeljko at holobit.net
Sun Feb 7 08:41:37 CET 2010


On Sunday 07 February 2010 00:08, JoshyFun wrote:

> No "problem" is not solved because:
>
> 1) EraseBackground is now invoked, but calling "inherited
> EraseBackground" does not perform the default erasebackground
> procedure.
>
> 2) Now background is completly gone due (1)
>
> 3) WMPaint is invoked but the paint is always performed (whichever
> result is set in the message) so the inner rect in the TEdit is
> cleared always.
>
> I think a deeper change in GTK is needed to handle this situation,
> maybe all controls must be APP_PAINTABLE and call some methods to
> perform the operations, but I'm not completly sure that it could be
> done in fact in GTK (following this logic).

No, same thing is with qt. APP_PAINTABLE = HasPaint with qt lcl.
This is how it goes:
1.Paint event comes to control.
2.If APP_PAINTABLE then LCL can do the job (usually forms,panels etc)
3.If not - ws paints control with current theme (always after your changes - 
so any of your changes via painting over such control are lost).
So whatever you do in paint event over TEdit, it's painted again by ws.
4.The trick which can be done 1st call control paint from ws, do your changes 
and say that result of event = true.
In that case we must have the way to tell ws that we want to paint that 
control (eg. TEdit).

zeljko




More information about the Lazarus mailing list