Mercurial > cpython-lru_cache-weakref
view Mac/BuildScript/seticon.m @ 77670:8beffdfa29cd
Remove obsolete fixapplepython23 script and PythonSystemFixes
installer package from the OS X Makefile for Python 3. It has
never worked on Python 3 and is not needed there as pre-10.3.9
installs are no longer supported.
| author | Ned Deily <nad@acm.org> |
|---|---|
| date | Sun, 24 Jun 2012 00:19:31 -0700 |
| parents | da7448ebce8b |
| children |
line wrap: on
line source
/* * 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; }
