MYWindowUtils.m
author Jens Alfke <jens@mooseyard.com>
Wed Sep 02 08:41:25 2009 -0700 (2009-09-02)
changeset 35 5cab3034d3a1
permissions -rw-r--r--
10.6 compatibility: Fix some new compiler warnings, and work around apparent regressions in NSTask and -stringByStandardizingPath.
     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