Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExpandBar/ExpandItem background/foreground colors in Java SWT

I'm looking to manage colors of headers of my expandItem in SWT, and I'm not able to change the background or the foreground (swt gtk 32bit) or only background (swt win 64).

Is there some particular way to do that? I'm already setting:

exp_bar.setBackground(new Color(display, GUISetting.MAIN_BACKGROUND));
exp_bar.setForeground(new Color(display, GUISetting.MAIN_TEXT_COLOR));

But this does not seem to work. Any ideas?

like image 930
user1417608 Avatar asked Feb 12 '26 08:02

user1417608


1 Answers

According to this page, this behaviour is intended. The widgets are supplied by the OS. The OS uses a texture and SWT decided, that you cannot set the color on a widget with a texture.

There is a bug report here that you can support.

However, these posts are quite old (2006). Maybe it was fixed till now, but I couldn't find anything...

like image 98
Baz Avatar answered Feb 14 '26 20:02

Baz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!