How to show a custom title bar icon in NSWindow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Force to show a titlebar icon | |
[window setRepresentedURL:[NSURL URLWithString:@"WindowTitle"]]; | |
// Set our custom icon | |
[[window standardWindowButton:NSWindowDocumentIconButton] setImage:[NSImage imageNamed:@"imagename"]]; | |
... | |
// Implement window delegate method to prevent to popup document (which do not exist) path menu when cmd+clicked | |
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu | |
{ | |
return NO; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment