- GetResInfo( resHandle , &theId , &theType , theName ) ;
- ReleaseResource( resHandle ) ;
+ Str255 theName ;
+
+ wxMacStringToPascal( filename , theName ) ;
+ Handle resHandle = GetNamedResource( 'icns' , theName ) ;
+ if ( resHandle != 0L )
+ {
+ IconFamilyHandle iconFamily = (IconFamilyHandle) resHandle ;
+ HLock((Handle) iconFamily);
+ OSStatus err = GetIconRefFromIconFamilyPtr( *iconFamily, GetHandleSize((Handle) iconFamily), &iconRef );
+ HUnlock((Handle) iconFamily);
+ if ( err != noErr )
+ {
+ wxFAIL_MSG("Error when constructing icon ref");
+ }
+
+ ReleaseResource( resHandle ) ;
+ }
+ }
+ if ( iconRef == NULL )
+ {
+ // TODO add other attempts to load it from files etc here