Skip to content

Instantly share code, notes, and snippets.

@franciscoadasme
Created June 5, 2011 03:40
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franciscoadasme/1008620 to your computer and use it in GitHub Desktop.
Save franciscoadasme/1008620 to your computer and use it in GitHub Desktop.
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