Back to index

python3.2  3.2.2
seticon.m File Reference
#import <Cocoa/Cocoa.h>
#include <stdio.h>

Go to the source code of this file.


int main (int argc, char **argv)

Function Documentation

int main ( int argc  ,
char **  argv 

Definition at line 7 of file seticon.m.

       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;