]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/fontdlgosx.mm
don't compare invalid iterators/node pointers
[wxWidgets.git] / src / mac / carbon / fontdlgosx.mm
index 938613c5f65398929dcfa7e308a15f68dce1498e..79a4c20fe85d6aa9693be2ec83c0566190461b2e 100644 (file)
@@ -64,7 +64,6 @@
 
     NSRect rectCancel = NSMakeRect( 10.0 , 10.0 , 82  , 24 );
     NSRect rectOK = NSMakeRect( 100.0 , 10.0 , 82  , 24 );
-    NSView* panel = [[NSView alloc] initWithFrame:rectBox];
     
     NSButton* cancelButton = [[NSButton alloc] initWithFrame:rectCancel];
     [cancelButton setTitle:(NSString*)cfCancelString.Detach()];
@@ -148,6 +147,7 @@ int RunMixedFontDialog(wxFontDialog* dialog)
     SetWindowGroup(carbonWindowRef , GetWindowGroupOfClass(kMovableModalWindowClass));
     
     [fontPanel setFloatingPanel:NO] ;
+    [[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:NO] ;
     
     wxMacFontPanelAccView* accessoryView = (wxMacFontPanelAccView*) [fontPanel accessoryView] ;
     if ( accessoryView == nil)
@@ -167,6 +167,8 @@ int RunMixedFontDialog(wxFontDialog* dialog)
 
     [NSApp endModalSession:session];
 
+    // if we don't reenable it, FPShowHideFontPanel does not work
+    [[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:YES] ;
     if( FPIsFontPanelVisible())
         FPShowHideFontPanel() ;