I think it's part of NSFileWrapper
and you might be able to do it with the App Store. I don't know.
NSFileWrapper *fw = [[NSFileWrapper alloc] initWithURL:fileURL,
// don't memory map, we only want to change the icon
options:NSFileWrapperReadingWithoutMapping
error:NULL];
[fw setIcon:updatedIcon];
Note that icon
and setIcon
are part of the ApplicationKit
category, not the main NSFileWrapper implementation in Foundation
: https://developer.apple.com/library/mac/#documentation/AppKit/Reference/NSFileWrapper_AppKitAdditions/NSFileWrapperApplicationKitAdditions.html
Edit: That's how you could have a progress bar. To make the close button you'd need an NSView
reference to the icon, like you can do with dock icons.
Edit 2: The WebKit browser does this too (not just Safari) so if you dug through the source you'd probably be able to find it.
Edit 3: I think it's done automatically by NSURLDownload
. You could use that style yourself if you made a fake download that was really generating the downloaded content on the fly. I don't believe it's possible to make an arbitrary clickable icon, though.