Skip to content

Instantly share code, notes, and snippets.

@evadne
Created December 25, 2009 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evadne/263672 to your computer and use it in GitHub Desktop.
Save evadne/263672 to your computer and use it in GitHub Desktop.
- (void) setAccessoryView: (NSView *)view {
if (view == nil) {
[accessoryView removeFromSuperview];
return;
}
NSView *themeFrame = [[self contentView] superview];
NSRect themeFrameRect = [themeFrame frame];
NSRect accessoryViewRect = [view frame];
[view setFrame:NSMakeRect(
themeFrameRect.size.width - accessoryViewRect.size.width,
themeFrameRect.size.height - accessoryViewRect.size.height,
accessoryViewRect.size.width,
accessoryViewRect.size.height
)];
[themeFrame addSubview:view];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment