diff --git a/src/osx/carbon/fontdlgosx.mm b/src/osx/carbon/fontdlgosx.mm index 19d64c972d..2d5b890c53 100644 --- a/src/osx/carbon/fontdlgosx.mm +++ b/src/osx/carbon/fontdlgosx.mm @@ -158,8 +158,8 @@ int RunMixedFontDialog(wxFontDialog* dialog) [fontPanel setFloatingPanel:NO] ; [[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:NO] ; - wxMacFontPanelAccView* accessoryView = (wxMacFontPanelAccView*) [fontPanel accessoryView] ; - if ( accessoryView == nil) + wxMacFontPanelAccView* accessoryView = nil; + if ( [fontPanel accessoryView] == nil || [[fontPanel accessoryView] class] != [wxMacFontPanelAccView class] ) { NSRect rectBox = NSMakeRect( 0 , 0 , 192 , 40 ); accessoryView = [[wxMacFontPanelAccView alloc] initWithFrame:rectBox]; @@ -168,6 +168,10 @@ int RunMixedFontDialog(wxFontDialog* dialog) [fontPanel setDefaultButtonCell:[[accessoryView okButton] cell]] ; } + else + { + accessoryView = (wxMacFontPanelAccView*)[fontPanel accessoryView]; + } [accessoryView resetFlags]; #if wxOSX_USE_COCOA