int parentGroup = OS.GetWindowGroupOfClass (windowClass); OS.SetWindowGroupParent (windowGroup, parentGroup);
if (parent != null) { parentGroup = parent.getShell ().windowGroup; } else { parentGroup = OS.GetWindowGroupOfClass (windowClass); }
void createHandle () {	state |= CANVAS | GRAB | HIDDEN;	int attributes = OS.kWindowStandardHandlerAttribute;	if (OS.HIVIEW) attributes |= OS.kWindowCompositingAttribute;	if ((style & SWT.NO_TRIM) == 0) {		if ((style & SWT.CLOSE) != 0) attributes |= OS.kWindowCloseBoxAttribute;		if ((style & SWT.MIN) != 0) attributes |= OS.kWindowCollapseBoxAttribute;		if ((style & SWT.MAX) != 0) attributes |= OS.kWindowFullZoomAttribute;		if ((style & SWT.RESIZE) != 0) {			attributes |= OS.kWindowResizableAttribute;			/*			* Bug in the Macintosh.  For some reason, a window has no title bar			* and the kWindowResizableAttribute, no rubber banding feedback is			* given while the window is resizing.  The fix is to create the window 			* with kWindowLiveResizeAttribute in this case.  This is inconsistent			* with other windows, but the user will get feedback when resizing.			*/			if ((style & SWT.TITLE) == 0) attributes |= OS.kWindowLiveResizeAttribute;		}	}	int windowClass = OS.kDocumentWindowClass;	if ((style & (SWT.CLOSE | SWT.TITLE)) == 0) windowClass = OS.kSheetWindowClass;	if ((style & (SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL | SWT.SYSTEM_MODAL)) != 0) {		if ((style & (SWT.CLOSE | SWT.MAX | SWT.MIN)) == 0)  {			windowClass = (style & SWT.TITLE) != 0 ? OS.kMovableModalWindowClass : OS.kModalWindowClass;		}	}	Monitor monitor = getMonitor ();	Rectangle rect = monitor.getClientArea ();	int width = rect.width * 5 / 8;	int height = rect.height * 5 / 8;	Rect bounds = new Rect ();	OS.SetRect (bounds, (short) 0, (short) 0, (short) width, (short) height);	int [] outWindow = new int [1];	attributes &= OS.GetAvailableWindowAttributes (windowClass);	OS.CreateNewWindow (windowClass, attributes, bounds, outWindow);	if (outWindow [0] == 0) error (SWT.ERROR_NO_HANDLES);	shellHandle = outWindow [0];	OS.RepositionWindow (shellHandle, 0, OS.kWindowCascadeOnMainScreen);//	OS.SetThemeWindowBackground (shellHandle, (short) OS.kThemeBrushDialogBackgroundActive, false);	int [] theRoot = new int [1];	if (OS.HIVIEW) {		OS.CreateRootControl (shellHandle, theRoot);		OS.GetRootControl (shellHandle, theRoot);	} else {		OS.HIViewFindByID (OS.HIViewGetRoot (shellHandle), OS.kHIViewWindowContentID (), theRoot);	}	if (theRoot [0] == 0) error (SWT.ERROR_NO_HANDLES);	if ((style & (SWT.H_SCROLL | SWT.V_SCROLL)) != 0) {		createScrolledHandle (theRoot [0]);	} else {		createHandle (theRoot [0]);	}	OS.SetControlVisibility (topHandle (), false, false);	int [] outGroup = new int [1];	OS.CreateWindowGroup (OS.kWindowGroupAttrHideOnCollapse, outGroup);	if (outGroup [0] == 0) error (SWT.ERROR_NO_HANDLES);	windowGroup = outGroup [0];	if (parent != null) {		Shell shell = parent.getShell ();		int parentGroup = shell.windowGroup;		OS.SetWindowGroup (shellHandle, parentGroup);		OS.SetWindowGroupParent (windowGroup, parentGroup);	} else {		int parentGroup = OS.GetWindowGroupOfClass (windowClass);		OS.SetWindowGroupParent (windowGroup, parentGroup);	}	OS.SetWindowGroupOwner (windowGroup, shellHandle);	CGPoint inMinLimits = new CGPoint (), inMaxLimits = new CGPoint ();	OS.GetWindowResizeLimits (shellHandle, inMinLimits, inMaxLimits);	if (DEFAULT_CLIENT_WIDTH == -1) DEFAULT_CLIENT_WIDTH = (int) inMinLimits.x;	if (DEFAULT_CLIENT_HEIGHT == -1) DEFAULT_CLIENT_HEIGHT = 0;	inMinLimits.y = (int) 0;	int trim = SWT.TITLE | SWT.CLOSE | SWT.MIN | SWT.MAX;	if ((style & SWT.NO_TRIM) != 0 || (style & trim) == 0) {		inMinLimits.x = (int) 0;		}	OS.SetWindowResizeLimits (shellHandle, inMinLimits, inMaxLimits);}