]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dialog.cpp
Add wxDataViewModel::ChangeValue() and use it in wxDVC implementation.
[wxWidgets.git] / src / osx / carbon / dialog.cpp
index 8855697d645486c0ff0b6dd279cbda663da05907..9924b54b06028dce197d051d1bf270542c30ac55 100644 (file)
@@ -41,23 +41,21 @@ void wxDialog::DoShowModal()
     if ( GetParent() == NULL )
     {
         windowGroup = GetWindowGroup(windowRef) ;
-        formerParentGroup = GetWindowGroupParent( windowGroup );
-        SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
-        resetGroupParent = true;
+        if ( windowGroup != GetWindowGroupOfClass( kMovableModalWindowClass ) )
+        {
+            formerParentGroup = GetWindowGroupParent( windowGroup );
+            SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
+            resetGroupParent = true;
+        }
     }
     BeginAppModalStateForWindow(windowRef) ;
 
-    wxEventLoop * const
-        loop = static_cast<wxEventLoop *>(wxEventLoop::GetActive());
-
-
-    wxASSERT_MSG( loop , wxT("No Event Loop in place") );
-
-    if ( loop )
-    {
-        while ( IsModal() )
-            loop->Dispatch();
-    }
+#if wxUSE_CONSOLE_EVENTLOOP
+    wxEventLoopGuarantor ensureHasLoop;
+#endif
+    wxEventLoopBase * const loop = wxEventLoop::GetActive();
+    while ( IsModal() )
+        loop->Dispatch();
 
     EndAppModalStateForWindow(windowRef) ;
     if ( resetGroupParent )