[Lazarus] GTK2 EraseBackgound

Paul Ishenin webpirat at mail.ru
Fri Feb 5 14:41:16 CET 2010


05.02.2010 19:57, JoshyFun wrote:
> Hello Lazarus-List,
>
> I wrote a little text induction feature to TCustomEdit, is is being
> done using LCL in Windows platform (without using Windows unit) where
> it works fine. The induction is the grayed text that appears in some
> textboxes like the attached one (taken from my windows code).
>
> To work in Windows it overrides the EraseBackground to paint the
> induction and the WMPaint message to not paint anything if no text
> available in the textbox.
>
> The problem is that in GTK2 this effect is not obtained as the
> EraseBackground is never called and message WMEraseBackground is never
> called also.
>
> GTK2 is almost new to me so I'm lost on how to solve this and if is in
> fact possible to solve it with the current LCL/GTK2 interaction.
>
> I hope somebody can give some hints or maybe simple says that
> "impossible with current LCL implementation".
EraseBackground message is only send for TCustomControl descendants. 
Therefore you get no message for TEdit.

Best regards,
Paul Ishenin.




More information about the Lazarus mailing list