diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2009-04-01 13:46:47 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2009-04-01 13:46:47 (GMT) |
commit | 1b564a4639d6db5bd1332d7be80bd48318812cb0 (patch) | |
tree | f1e3518d0adff6e9b1aaec1287a70c053e5b12a7 | |
parent | 323b26b7eb75f1d0820c625bdd6642181eb732af (diff) | |
download | cpython-1b564a4639d6db5bd1332d7be80bd48318812cb0.zip cpython-1b564a4639d6db5bd1332d7be80bd48318812cb0.tar.gz cpython-1b564a4639d6db5bd1332d7be80bd48318812cb0.tar.bz2 |
Merge seticon.m file, for some reason 'svnmerge'
didn't actually add this file to the repository
(probably due me not being awake enough at the
time of the initial merge)
-rw-r--r-- | Mac/BuildScript/seticon.m | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Mac/BuildScript/seticon.m b/Mac/BuildScript/seticon.m new file mode 100644 index 0000000..04e3d7d --- /dev/null +++ b/Mac/BuildScript/seticon.m @@ -0,0 +1,26 @@ +/* + * Simple tool for setting an icon on a file. + */ +#import <Cocoa/Cocoa.h> +#include <stdio.h> + +int main(int argc, char** argv) +{ + if (argc != 3) { + fprintf(stderr, "Usage: seticon ICON TARGET"); + return 1; + } + + NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + NSString* iconPath = [NSString stringWithUTF8String:argv[1]]; + NSString* filePath = [NSString stringWithUTF8String:argv[2]]; + + [NSApplication sharedApplication]; + + [[NSWorkspace sharedWorkspace] + setIcon: [[NSImage alloc] initWithContentsOfFile: iconPath] + forFile: filePath + options: 0]; + [pool release]; + return 0; +} |