RKM
RKM

Reputation: 3241

How to set a darker shade for SWT.PUSH button when it is toggled

By default, if a SWT.PUSH button is selected (toggled), the button is lightly blue shaded. I want to make the shade a little darker, so it is more visible which buttons are toggled. Does anyone know how i could go about doing this? Thanks.

Upvotes: 1

Views: 271

Answers (1)

Baz
Baz

Reputation: 36884

The documentation of Control contains this section for the method Control#setBackground(Color):

Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.

Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.


However, you can "hijack" the painting event and paint whatever you want on your Button. Here is a related question to this topic.

Upvotes: 2

Related Questions