/
githubmirror
/
cpython
Обзор
Документация
Войти
/
githubmirror
/
cpython
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.13.11
Mac/BuildScript/seticon.m
26 строк
598 B
Ronald Oussoren
Merged revisions 70727 via svnmerge from
30 мар 2009, 21:20
30 мар 2009, 21:20
207b4c2
Код
Авторство
О чём код?
/* * 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; }