+ if ( GetParent() == NULL )
+ {
+ windowGroup = GetWindowGroup(windowRef) ;
+ formerParentGroup = GetWindowGroupParent( windowGroup );
+ SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
+ resetGroupParent = true;
+ }
+ BeginAppModalStateForWindow(windowRef) ;
+
+ while ( IsModal() )