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.
     1 //
     2 //  MYWindowUtils.m
     3 //  Murky
     4 //
     5 //  Created by Jens Alfke on 5/5/09.
     6 //  Copyright 2009 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import "MYWindowUtils.h"
    10 
    11 
    12 @implementation NSWindow (MYUtilities)
    13 
    14 
    15 - (void) my_setTitleBarIcon: (NSImage*)icon
    16 {
    17     NSURL *url = nil;
    18     if( icon ) {
    19         icon = [[icon copy] autorelease];
    20         [icon setSize: NSMakeSize(16,16)];
    21         url = [NSURL fileURLWithPath: @"/System/XXX"];
    22     }
    23     [self setRepresentedURL: url];
    24     [[self standardWindowButton:NSWindowDocumentIconButton] setImage: icon];
    25 }
    26 
    27 @end