[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Label background

Grant Gayed wrote:
Hi,

True transparency like this is not supported, setBackgroundMode() will only
inheirit a paren't background based on its colour or its background image.
I think the only way to fake it is to draw the parent's content to an image
and set it as the background image, as demonstrated below.  The provided
snippet is very simple though, and the Shell does not have style
SWT.NO_BACKGROUND, so using this approach may or may not be realistic in
your context, depending on how frequently the parent's drawn content
changes.


There's in fact an open bug about this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=217092.


The solution that you speak of does not work for e.g. when the background is a gradient, and the background is not a flat color, but varies depending on where the control is placed on the background, or the background gets resized.

Cheers,
Ketan Padegaonkar
http://swtbot.org/ - a functional testing tool for SWT/Eclipse