Tapy
Tapy

Reputation: 1054

Changing the icon on the "window bar" Mac OS X

I was wondering how I could change the icon in the "window bar" of my Mac app. I've also added a picture of the icon I want to change, since I believe that "window bar" isn't the correct term.

screenshot

Upvotes: 1

Views: 356

Answers (2)

omz
omz

Reputation: 53561

I think it's called "proxy icon" and it's controlled by the NSWindow method setRepresentedFilename: The icon gets set automatically based on the type of the file that is represented by the icon.

Be aware that the icon can be dragged by the user (as a file), so only use this, as the method name suggests, to set the file that the window represents. If you're coming from Windows, you might be tempted to put your app icon in there. Don't.

Upvotes: 4

jtbandes
jtbandes

Reputation: 118761

You'll want to use -setRepresentedFilename:or the other similar methods. I don't think you can just change the icon to anything, it has to be associated with a file.

Upvotes: 1

Related Questions