source: trunk/macosx/ExpandedPathToIconTransformer.m @ 1037

Last change on this file since 1037 was 1037, checked in by livings124, 15 years ago

Use bindings to show text and icon of pulldown menu items.

File size: 508 bytes
Line 
1
2#import "ExpandedPathToIconTransformer.h"
3
4@implementation ExpandedPathToIconTransformer
5
6+ (Class) transformedValueClass
7{
8    return [NSImage class];
9}
10
11+ (BOOL) allowsReverseTransformation
12{
13    return NO;
14}
15
16- (id) transformedValue: (id) value
17{
18    if (!value)
19        return nil;
20   
21    NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFile: [value stringByExpandingTildeInPath]];
22    [icon setScalesWhenResized: YES];
23    [icon setSize: NSMakeSize(16.0, 16.0)];
24   
25    return icon;
26}
27
28
29@end
Note: See TracBrowser for help on using the repository browser.