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; return;
if ((state & PARENT_BACKGROUND) != 0 && (state & BACKGROUND) == 0 && backgroundImage == null) { setParentBackground (); } else { if (backgroundImage != null) { int [] argList = {OS.XmNbackgroundPixmap, backgroundImage.pixmap}; OS.XtSetValues (handle, argList, argList.length / 2); } else {  int pixel = getBackgroundPixel (); setBackgroundPixel (pixel + 1); setBackgroundPixel (pixel);
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;			return;		}		if (composite == shell) break;		composite = composite.parent;	} while (true);}