From f8251232715b8d1b8cc6e708e619b3f88d8b025f Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 6 Dec 2011 18:35:49 +0000 Subject: [PATCH] avoiding NSToolbarSeparatorItemIdentifier under Lion, where it is not supported anymore, fixes #13363 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/toolbar.mm | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index 344f8b7ef4..41daeac737 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -1100,8 +1100,15 @@ bool wxToolBar::Realize() NSString *nsItemId; if (tool->GetStyle() == wxTOOL_STYLE_SEPARATOR) { - nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier - : NSToolbarSeparatorItemIdentifier; + if ( tool->IsStretchable() ) + nsItemId = NSToolbarFlexibleSpaceItemIdentifier; + else + { + if ( UMAGetSystemVersion() < 0x1070 ) + nsItemId = NSToolbarSeparatorItemIdentifier; + else + nsItemId = NSToolbarSpaceItemIdentifier; + } } else { @@ -1350,8 +1357,18 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) #if wxOSX_USE_NATIVE_TOOLBAR if (m_macToolbar != NULL) { - NSString * nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier - : NSToolbarSeparatorItemIdentifier; + NSString * nsItemId = nil; + + if ( tool->IsStretchable() ) + nsItemId = NSToolbarFlexibleSpaceItemIdentifier; + else + { + if ( UMAGetSystemVersion() < 0x1070 ) + nsItemId = NSToolbarSeparatorItemIdentifier; + else + nsItemId = NSToolbarSpaceItemIdentifier; + } + NSToolbarItem* item = [[NSToolbarItem alloc] initWithItemIdentifier:nsItemId]; tool->SetToolbarItemRef( item ); } -- 2.45.2