开发者

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

开发者 https://www.devze.com 2023-03-31 00:39 出处:网络
I was wondering how I could change the icon in the \"window bar\" of my Ma开发者_C百科c app. I\'ve also added a picture of the icon I want to change, since I believe that \"window bar\" isn\'t the cor

I was wondering how I could change the icon in the "window bar" of my Ma开发者_C百科c 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.

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消