Skip to content

Instantly share code, notes, and snippets.

Created June 5, 2011 03:40
What would you like to do?
How to show a custom title bar icon in NSWindow
// 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