开发者

Where are the image files for the constants in NSImage located?

开发者 https://www.devze.com 2022-12-27 21:47 出处:网络
I\'d like to get 开发者_StackOverflow中文版the image files for the constants definied in NSImage.h, like NSImageNameGoRightTemplate for example. I\'d like to copy and edit some of them. Does anybody k

I'd like to get 开发者_StackOverflow中文版the image files for the constants definied in NSImage.h, like NSImageNameGoRightTemplate for example. I'd like to copy and edit some of them. Does anybody know where those images are located? I'm too stupid to find them on the drive...


As far as I know, they are not located in a single place, and their names may not reflect at all the name of the constants.

They can be located in the 'Resources' folder of a framework, like

/System/Library/Frameworks/AppKit.framework/Resources/

or directly in an application, like

/System/Library/CoreServices/Finder.app/Contents/Resources/

You may also take a look at a theming app, like CandyBar. Maybe you'll be able to see some paths in the binary.


I use a category-extension with this array if I want the images:

@implementation NSImage (SystemImages)

+ (NSArray*) systemImages {
    static NSArray *images;

    return images = images ?: ({
        NSMutableArray *imgs = @[].mutableCopy;

        for (id name in @[
            NSImageNameQuickLookTemplate,
            NSImageNameBluetoothTemplate,
            NSImageNameIChatTheaterTemplate,
            NSImageNameSlideshowTemplate,
            NSImageNameActionTemplate,
            NSImageNameSmartBadgeTemplate,
            NSImageNameIconViewTemplate,
            NSImageNameListViewTemplate,
            NSImageNameColumnViewTemplate,
            NSImageNameFlowViewTemplate,
            NSImageNamePathTemplate,
            NSImageNameInvalidDataFreestandingTemplate,
            NSImageNameLockLockedTemplate,
            NSImageNameLockUnlockedTemplate,
            NSImageNameGoRightTemplate,
            NSImageNameGoLeftTemplate,
            NSImageNameRightFacingTriangleTemplate,
            NSImageNameLeftFacingTriangleTemplate,
            NSImageNameAddTemplate,
            NSImageNameRemoveTemplate,
            NSImageNameRevealFreestandingTemplate,
            NSImageNameFollowLinkFreestandingTemplate,
            NSImageNameEnterFullScreenTemplate,
            NSImageNameExitFullScreenTemplate,
            NSImageNameStopProgressTemplate,
            NSImageNameStopProgressFreestandingTemplate,
            NSImageNameRefreshTemplate,
            NSImageNameRefreshFreestandingTemplate,
            NSImageNameBonjour,
            NSImageNameComputer,
            NSImageNameFolderBurnable,
            NSImageNameFolderSmart,
            NSImageNameFolder,
            NSImageNameNetwork,
            NSImageNameDotMac,
            NSImageNameMobileMe,
            NSImageNameMultipleDocuments,
            NSImageNameUserAccounts,
            NSImageNamePreferencesGeneral,
            NSImageNameAdvanced,
            NSImageNameInfo,
            NSImageNameFontPanel,
            NSImageNameColorPanel,
            NSImageNameUser,
            NSImageNameUserGroup,
            NSImageNameEveryone,
            NSImageNameUserGuest,
            NSImageNameMenuOnStateTemplate,
            NSImageNameMenuMixedStateTemplate,
            NSImageNameApplicationIcon,
            NSImageNameTrashEmpty,
            NSImageNameTrashFull,
            NSImageNameHomeTemplate,
            NSImageNameBookmarksTemplate,
            NSImageNameCaution,
            NSImageNameStatusAvailable,
            NSImageNameStatusPartiallyAvailable,
            NSImageNameStatusUnavailable,
            NSImageNameStatusNone
        ])
        {
            [imgs addObject:[NSImage imageNamed:name]];
        }
        imgs.copy;
    });
}

@end
0

精彩评论

暂无评论...
验证码 换一张
取 消