Last active
April 16, 2018 07:30
-
-
Save hofiorg/ff1fcb733d6b41ebada98ff0823246f9 to your computer and use it in GitHub Desktop.
set background color to SWT composites recursive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void colorSubComposites(Composite co, int color) { | |
Control [] controls = co.getChildren(); | |
co.setBackground(getShell().getDisplay().getSystemColor(color)); | |
for(Control control : controls) { | |
if(control instanceof Composite) | |
colorSubComposites((Composite)control, color); | |
} | |
} | |
// USAGE: colorSubComposites(co, SWT.COLOR_RED); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment