Shell shell = getShell (); if (this == shell) return; Composite composite = parent; do { int mode = composite.backgroundMode; if (mode != 0) { if (mode == SWT.INHERIT_DEFAULT) { Control control = this; do { if ((control.state & THEME_BACKGROUND) == 0) return; control = control.parent; } while (control != composite); } state |= PARENT_BACKGROUND; Control control = findBackgroundControl (); if (control == null) return; if (control.backgroundImage != null) { shell.releaseBrushes (); updateBackgroundImage (); } else { updateBackgroundColor (); } return; } if (composite == shell) break; composite = composite.parent; } while (true);
Control control = findBackgroundControl (); if (control == null) control = this; if (control.backgroundImage != null) { Shell shell = getShell (); shell.releaseBrushes (); setBackgroundImage (control.backgroundImage.handle); } else { setBackgroundPixel (control.background == -1 ? control.defaultBackground() : control.background); }
void setBackground () {	Shell shell = getShell ();	if (this == shell) return;	Composite composite = parent;	do {		int mode = composite.backgroundMode;		if (mode != 0) {			if (mode == SWT.INHERIT_DEFAULT) {				Control control = this;				do {					if ((control.state & THEME_BACKGROUND) == 0) return;					control = control.parent;				} while (control != composite);			}			state |= PARENT_BACKGROUND;			Control control = findBackgroundControl ();			if (control == null) return;			if (control.backgroundImage != null) {				shell.releaseBrushes ();				updateBackgroundImage ();					} else {				updateBackgroundColor ();			}			return;		}		if (composite == shell) break;		composite = composite.parent;	} while (true);}