FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Mac/BuildScript/seticon.m at v3.6.15 · python/cpython · GitHub
python
cpython
Repository navigation
Code
Issues
5k+
(5k+)
Pull requests
2.5k
(2.5k)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Mac
/
BuildScript
/
seticon.m
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (22 loc) · 598 Bytes
Breadcrumbs
cpython
/
Mac
/
BuildScript
/
seticon.m
Copy path
File metadata and controls
26 lines (22 loc) · 598 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
;
}
Back
|
FazBrowse Home
|
New Git URL