Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-01

Should Frames be transparent?

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tony Whyman

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?

Reply by email