source: trunk/Cocoa/Pester/Source/NSImage-OAExtensions.m@ 632

Last change on this file since 632 was 587, checked in by Nicholas Riley, 15 years ago

Fix some problems/deprecation identified by compiling with the 10.6 SDK.

File size: 1.0 KB
Line 
1// Copyright 1997-2002 Omni Development, Inc. All rights reserved.
2//
3// This software may only be used and reproduced according to the
4// terms in the file OmniSourceLicense.html, which should be
5// distributed with this project and can also be found at
6// http://www.omnigroup.com/DeveloperResources/OmniSourceLicense.html.
7
8#import "NSImage-OAExtensions.h"
9
10#import <AppKit/AppKit.h>
11
12// RCS_ID("$Header: /Network/Source/CVS/OmniGroup/Frameworks/OmniAppKit/OpenStepExtensions.subproj/NSImage-OAExtensions.m,v 1.17 2002/03/09 01:53:54 kc Exp $")
13
14@implementation NSImage (OAExtensions)
15
16+ (NSImage *)imageNamed:(NSString *)imageName inBundle:(NSBundle *)aBundle;
17{
18 NSImage *image;
19 NSString *path;
20
21 image = [self imageNamed:imageName];
22 if (image && [image size].width != 0)
23 return image;
24
25 path = [aBundle pathForImageResource:imageName];
26 if (!path)
27 return nil;
28
29 image = [[NSImage alloc] initWithContentsOfFile:path];
30 [image setName:imageName];
31
32 return [image autorelease];
33}
34
35@end
Note: See TracBrowser for help on using the repository browser.