]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/nonownedwnd.mm
Make public headers compatible with Objective-C++ with ARC.
[wxWidgets.git] / src / osx / cocoa / nonownedwnd.mm
index 279e45f30a351bef3b924b08645e6bebceb7440b..9e79c6a458e45b250d746b9802a6b8d1d242ea57 100644 (file)
@@ -658,7 +658,7 @@ long style, long extraStyle, const wxString& WXUNUSED(name) )
     // If the parent is modal, windows with wxFRAME_FLOAT_ON_PARENT style need
     // to be in kCGUtilityWindowLevel and not kCGFloatingWindowLevel to stay
     // above the parent.
-    wxDialog * const parentDialog = wxDynamicCast(parent, wxDialog);
+    wxDialog * const parentDialog = parent == NULL ? NULL : wxDynamicCast(parent->MacGetTopLevelWindow(), wxDialog);
     if (parentDialog && parentDialog->IsModal())
     {
         if (level == kCGFloatingWindowLevel)