support icns in bundle
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -321,6 +321,25 @@ bool wxIcon::LoadIconFromBundleResource(const wxString& resourceName, int desire
|
||||
ReleaseResource( resHandle ) ;
|
||||
}
|
||||
}
|
||||
if ( iconRef == NULL )
|
||||
{
|
||||
wxCFStringRef name(resourceName);
|
||||
FSRef iconFSRef;
|
||||
|
||||
wxCFRef<CFURLRef> 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 )
|
||||
{
|
||||
|
Reference in New Issue
Block a user