MYWindowUtils.m
author Olivier Scherler <oscherler@femto-byte.com>
Tue May 12 14:38:30 2009 +0200 (2009-05-12)
changeset 30 2befbe36c746
permissions -rw-r--r--
Changed -[MYDirectoryEvent relativePath] to work on standardised paths, in case symlinks are used. Fixes issue #28 in Murky.
jens@28
     1
//
jens@28
     2
//  MYWindowUtils.m
jens@28
     3
//  Murky
jens@28
     4
//
jens@28
     5
//  Created by Jens Alfke on 5/5/09.
jens@28
     6
//  Copyright 2009 Jens Alfke. All rights reserved.
jens@28
     7
//
jens@28
     8
jens@28
     9
#import "MYWindowUtils.h"
jens@28
    10
jens@28
    11
jens@28
    12
@implementation NSWindow (MYUtilities)
jens@28
    13
jens@28
    14
jens@28
    15
- (void) my_setTitleBarIcon: (NSImage*)icon
jens@28
    16
{
jens@28
    17
    NSURL *url = nil;
jens@28
    18
    if( icon ) {
jens@28
    19
        icon = [[icon copy] autorelease];
jens@28
    20
        [icon setSize: NSMakeSize(16,16)];
jens@28
    21
        url = [NSURL fileURLWithPath: @"/System/XXX"];
jens@28
    22
    }
jens@28
    23
    [self setRepresentedURL: url];
jens@28
    24
    [[self standardWindowButton:NSWindowDocumentIconButton] setImage: icon];
jens@28
    25
}
jens@28
    26
jens@28
    27
@end