Skip to content

Instantly share code, notes, and snippets.

@PaulChana
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save PaulChana/2e0e6be4e063dbe499f6 to your computer and use it in GitHub Desktop.

Select an option

Save PaulChana/2e0e6be4e063dbe499f6 to your computer and use it in GitHub Desktop.
Put a control in NSWindow titlebar
NSView *themeFrame = [[mainWindow contentView] superview];
NSRect c = [themeFrame frame];
NSRect aV = [accessoryView frame];
NSRect newFrame = NSMakeRect(c.size.width - aV.size.width,
c.size.height - aV.size.height,
aV.size.width,
aV.size.height);
[accessoryView setFrame:newFrame];
[themeFrame addSubview:accessoryView];
// NOTE - Make sure that accessory view has proper autosizing flags set
@PaulChana
Copy link
Author

NOTE - will work on 10.10, but will throw and error and shouldn't be used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment