]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/icon.cpp
Explicitly set "C" locale for the tests using decimal point.
[wxWidgets.git] / src / osx / carbon / icon.cpp
index f391772e7574a505bec129d9dec02cb17c4fc4a1..43cd52dce499a02aee92fec873cc4399357c30bf 100644 (file)
@@ -321,6 +321,26 @@ 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 );
+            }
+            ReleaseResource( (Handle) iconFamily );
+        }
+    }
 
     if ( iconRef )
     {