[lazarus] Form repaintis when painting speedbuton glyph

Marc Weustink weus at quicknet.nl
Tue May 2 18:13:48 EDT 2000


At 00:00 03-05-2000 +0200, Vincent Snijders wrote:
>Hi,
>
>I have been looking at the problem with the speedbuttons in win32. I haven't
>found a solution but I know more or less what is hapening, not the reason
>why.
>
>The problem is in painting the glyph on the button face. This paint action
>(a copyrect on a canvas) causes gtk to emit (is that the right word) an
>expose-event on the form and the form get repainted, which includes
>repainting the speedbutton etc, etc.

Hmmm.... In order to get a paint message on the first exposure of a form I 
generated a LM_Paint message on an expose-event. At least on Linux you 
don't get a paint event when a form is shown for the first time (you will 
get an expose).

If a draw results in an expose on the win32 platform I think it might be a 
bug in the libs, or I don't understand what an expose event means and it 
doesnt work on a Linux platform

>Commenting out
>     TButtonGlyph(FGlyph).Draw(Canvas, PaintRect, Offset, Caption, FLayout,
>FMargin,  FSpacing, FState, Transparent, (0));
>in the Procedure TSpeedbutton.Paint stops the repainting.
>
>The reason why I can't solve this problem is a huge lack of knowledge on
>graphics (DC etc) and gtk's interface to the graphics.
>You might take a look at the stretchBlt function in gtkwinapi.inc. The
>problem might be solved there.
>
>I hope this helps somebody.

Thanks, it gives a point to look at.

Marc










More information about the Lazarus mailing list