diff --git a/src/osx/carbon/icon.cpp b/src/osx/carbon/icon.cpp index f391772e75..50bd2b8c5a 100644 --- a/src/osx/carbon/icon.cpp +++ b/src/osx/carbon/icon.cpp @@ -321,6 +321,25 @@ bool wxIcon::LoadIconFromBundleResource(const wxString& resourceName, int desire ReleaseResource( resHandle ) ; } } + if ( iconRef == NULL ) + { + wxCFStringRef name(resourceName); + FSRef iconFSRef; + + wxCFRef iconURL(CFBundleCopyResourceURL(CFBundleGetMainBundle(), name, CFSTR("icns"), NULL)); + + if (CFURLGetFSRef(iconURL, &iconFSRef)) + { + // Get a handle on the icon family + IconFamilyHandle iconFamily; + OSStatus err = ReadIconFromFSRef( &iconFSRef, &iconFamily ); + + if ( err == noErr ) + { + err = GetIconRefFromIconFamilyPtr( *iconFamily, GetHandleSize((Handle) iconFamily), &iconRef ); + } + } + } if ( iconRef ) {