# HG changeset patch # User Jens Alfke # Date 1241546946 25200 # Node ID 206903ba35a57f7f44528243004237349777c266 # Parent 256370e8935a99012d2245b1aab858128acf563d Added MYWindowUtils, being used by Murky. diff -r 256370e8935a -r 206903ba35a5 MYWindowUtils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MYWindowUtils.h Tue May 05 11:09:06 2009 -0700 @@ -0,0 +1,16 @@ +// +// MYWindowUtils.h +// Murky +// +// Created by Jens Alfke on 5/5/09. +// Copyright 2009 Jens Alfke. All rights reserved. +// + +#import + + +@interface NSWindow (MYUtilities) + +- (void) my_setTitleBarIcon: (NSImage*)icon; + +@end diff -r 256370e8935a -r 206903ba35a5 MYWindowUtils.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MYWindowUtils.m Tue May 05 11:09:06 2009 -0700 @@ -0,0 +1,27 @@ +// +// MYWindowUtils.m +// Murky +// +// Created by Jens Alfke on 5/5/09. +// Copyright 2009 Jens Alfke. All rights reserved. +// + +#import "MYWindowUtils.h" + + +@implementation NSWindow (MYUtilities) + + +- (void) my_setTitleBarIcon: (NSImage*)icon +{ + NSURL *url = nil; + if( icon ) { + icon = [[icon copy] autorelease]; + [icon setSize: NSMakeSize(16,16)]; + url = [NSURL fileURLWithPath: @"/System/XXX"]; + } + [self setRepresentedURL: url]; + [[self standardWindowButton:NSWindowDocumentIconButton] setImage: icon]; +} + +@end