[Lazarus] Should Frames be transparent?

Tony Whyman tony.whyman at mccallumwhyman.com
Wed Jan 11 13:00:00 CET 2017


I suppose that this could be one of those "is it a feature or is it a 
bug" type questions, but it is also a big difference in behaviour 
between Linux and Windows.

I've realised that if you create a simple application with an image on a 
form and then partially or wholly overlay it with a frame or a even a 
radio group then:

- On Linux: the frame and radio group are not transparent and obscure 
the image.

- On Windows: the frame and radio group are  transparent, have no 
background, and the image shows through.

This applies to both IDE and a running program.

In the windows version, I came readily make the frame opaque when the 
program runs by simply overriding its Paint method as follows:

procedure TFrame1.Paint;
begin
   EraseBackground(Canvas.handle);
   inherited Paint;
end;

So the reason for the transparency is also certainly that the frame's 
background is not being erased under Windows but is being erased under 
Linux.

So bug or feature?



More information about the Lazarus mailing list