Reputation: 5367
I would like to have an NSWindow that is resizable but without showing the little green resize button in the top left corner. Is this possible?
Upvotes: 1
Views: 325
Reputation: 5576
Create custom subclass of NSWindow and override "standardWindowButton: forStyleMask:" class method
@interface CustomWindow : NSWindow
@end
@implementation CustomWindow
+ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSUInteger)styleMask
{
NSButton *button = [super standardWindowButton:b forStyleMask:styleMask];
if (b == NSWindowZoomButton) {
button.hidden = YES;
}
return button;
}
Upvotes: 3