use cleaner OSX version (10.3 upwards)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -396,9 +396,14 @@ IconRef wxBitmapRefData::GetIconRef()
|
|||||||
PicHandle pic = GetPictHandle() ;
|
PicHandle pic = GetPictHandle() ;
|
||||||
SetIconFamilyData( iconFamily, 'PICT' , (Handle) pic ) ;
|
SetIconFamilyData( iconFamily, 'PICT' , (Handle) pic ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// transform into IconRef
|
// transform into IconRef
|
||||||
|
#ifdef __WXMAC_OSX__
|
||||||
|
// cleaner version existing from 10.3 upwards
|
||||||
|
HLock((Handle) iconFamily);
|
||||||
|
OSStatus err = GetIconRefFromIconFamilyPtr( *iconFamily, GetHandleSize((Handle) iconFamily), &m_iconRef );
|
||||||
|
HUnlock((Handle) iconFamily);
|
||||||
|
wxASSERT_MSG( err == noErr , wxT("Error when constructing icon ref") );
|
||||||
|
#else
|
||||||
static int iconCounter = 2 ;
|
static int iconCounter = 2 ;
|
||||||
|
|
||||||
OSStatus err = RegisterIconRefFromIconFamily( 'WXNG' , (OSType) iconCounter, iconFamily, &m_iconRef ) ;
|
OSStatus err = RegisterIconRefFromIconFamily( 'WXNG' , (OSType) iconCounter, iconFamily, &m_iconRef ) ;
|
||||||
@@ -407,8 +412,9 @@ IconRef wxBitmapRefData::GetIconRef()
|
|||||||
// we have to retain a reference, as Unregister will decrement it
|
// we have to retain a reference, as Unregister will decrement it
|
||||||
AcquireIconRef( m_iconRef ) ;
|
AcquireIconRef( m_iconRef ) ;
|
||||||
UnregisterIconRef( 'WXNG' , (OSType) iconCounter ) ;
|
UnregisterIconRef( 'WXNG' , (OSType) iconCounter ) ;
|
||||||
DisposeHandle( (Handle) iconFamily ) ;
|
|
||||||
++iconCounter ;
|
++iconCounter ;
|
||||||
|
#endif
|
||||||
|
DisposeHandle( (Handle) iconFamily ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_iconRef ;
|
return m_iconRef ;
|
||||||
|
Reference in New Issue
Block a user