From 8dfed6e742f6caf6f5831c9df5d52da859bf22d9 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 22 Oct 2002 15:41:00 +0000 Subject: [PATCH] changed notebook icon code to only trigger under 10.2 and later (it is not working/buggy under 10.1.X) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/notebmac.cpp | 6 +++--- src/mac/notebmac.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index e6b6aaac6b..cec84b1ba0 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -371,7 +371,7 @@ void wxNotebook::MacSetupTabs() SetTabEnabled( (ControlHandle) m_macControl , ii+1 , true ) ; #if TARGET_CARBON - if ( GetImageList() && GetPageImage(ii) >= 0 ) + if ( GetImageList() && GetPageImage(ii) >= 0 && UMAGetSystemVersion() >= 0x1020 ) { // tab controls only support very specific types of images, therefore we are doing an odyssee // accross the icon worlds (even Apple DTS did not find a shorter path) @@ -391,8 +391,8 @@ void wxNotebook::MacSetupTabs() info.u.iconRef = iconRef ; SetControlData( (ControlHandle) m_macControl, ii+1,kControlTabImageContentTag, sizeof( info ), (Ptr)&info ); - // we ignore the error, since if there is no support for icons on tabs, the data cannot be set - UnregisterIconRef( 'WXNG' , (OSType) 1 ) ; + wxASSERT_MSG( err == noErr , "Error when setting icon on tab" ) ; + UnregisterIconRef( 'WXNG' , (OSType) 1 ) ; ReleaseIconRef( iconRef ) ; DisposeHandle( (Handle) iconFamily ) ; } diff --git a/src/mac/notebmac.cpp b/src/mac/notebmac.cpp index e6b6aaac6b..cec84b1ba0 100644 --- a/src/mac/notebmac.cpp +++ b/src/mac/notebmac.cpp @@ -371,7 +371,7 @@ void wxNotebook::MacSetupTabs() SetTabEnabled( (ControlHandle) m_macControl , ii+1 , true ) ; #if TARGET_CARBON - if ( GetImageList() && GetPageImage(ii) >= 0 ) + if ( GetImageList() && GetPageImage(ii) >= 0 && UMAGetSystemVersion() >= 0x1020 ) { // tab controls only support very specific types of images, therefore we are doing an odyssee // accross the icon worlds (even Apple DTS did not find a shorter path) @@ -391,8 +391,8 @@ void wxNotebook::MacSetupTabs() info.u.iconRef = iconRef ; SetControlData( (ControlHandle) m_macControl, ii+1,kControlTabImageContentTag, sizeof( info ), (Ptr)&info ); - // we ignore the error, since if there is no support for icons on tabs, the data cannot be set - UnregisterIconRef( 'WXNG' , (OSType) 1 ) ; + wxASSERT_MSG( err == noErr , "Error when setting icon on tab" ) ; + UnregisterIconRef( 'WXNG' , (OSType) 1 ) ; ReleaseIconRef( iconRef ) ; DisposeHandle( (Handle) iconFamily ) ; }