Larry
Larry

Reputation: 397

Changing the titlebar height in an NSPanel

I'm trying to change the titlebar height of an NSPanel. I tried the following but it didn't work as expected:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  NSRect f = [[[window contentView] superview] frame];
  f.size.height += 10;
  [[window contentView] superview].frame = f;
}

Upvotes: 1

Views: 381

Answers (1)

Rob Keniger
Rob Keniger

Reputation: 46028

You can't change the height of a window's title bar. It's fixed by the framework. If you want a window with a custom appearance you'll need to create a window using the NSBorderlessWindowMask style mask and then draw your own title bar and widgets.

Upvotes: 3

Related Questions