Reputation: 2490
I have a window with some content that could be previewed, mailed,...
I decided that the best way to do this is to put appropriate application icons in toolbar, namely from Mail, Preview,...
Trick is, how to do that? Is thee any way too access other's application package and have access to its icon? Or is there any other elegant way?
Upvotes: 1
Views: 435
Reputation: 2490
There is also one other way of doing it, especially if you are building toolbar in IB:
You will get complete set of application icons in any size. You can export them and put them in Image Well in IB
Upvotes: 0
Reputation: 27073
Code:
// Get icon
NSImage *theIcon = [[NSWorkspace sharedWorkspace] iconForFile:@"/Applications/Mail.app"];
// Display icon (irrelevant in your case)
[theIcon setSize:NSMakeSize(128, 128)];
[theImageView setImage:theIcon];
Upvotes: 4