Forum > LCL
How to make a T[Flow]Panel translucent under Linux
(1/1)
pleumann:
Hi,
I'm using a TFlowPanel to arrange some buttons. The panel is by default translucent on MacOS (where I develop most of the time), but has a light gray background on Raspberry Pi / Linux (where I ultimately need to deploy to). This is bad because my form has a background wallpaper that is then being covered up by the empty parts of the panel. I tried all sorts of tricks already (played with Color/ParentColor, assigned empty OnPaint), but to no avail. Is this a general limitation of the Linux target or the GTK widget set or could it be caused by the older Lazarus 2.0.6 on Raspberry Pi (I use 2.2.6 on MacOS)?
Cheers
Joerg
pleumann:
Update: It's not the older Lazarus. I installed 2.2.6 on an Ubuntu box and it has the same issue. So it's probably GTK ignoring my attempts to make the panel's background transparent.
jamie:
Technically speaking, you are most likely to have the transparent background because its not supposed to be.
I suppose if you captured the WM_ERASEBKGRD message and prevent it from painting you may get somewhere.
pleumann:
--- Quote from: jamie on June 05, 2023, 11:12:11 pm ---Technically speaking, you are most likely to have the transparent background because its not supposed to be.
I suppose if you captured the WM_ERASEBKGRD message and prevent it from painting you may get somewhere.
--- End quote ---
Not sure what you mean. Are you trying to say the behavior on MacOS is actually the buggy one and panels are always supposed to be solid?
Also, capturing the message means subclassing (as far as I can see), in which case I could probably just as well override Paint() as just calling PaintChildren() without cleaning the background. But I'd have to get my changed component into the gallery, which I'd like to avoid. I was hoping there is some easy, defined and portable way of doing this (transparency color or so).
Navigation
[0] Message Index