Objective c 在不显示“调整大小”按钮的情况下调整窗口大小
我希望有一个可调整大小但不在左上角显示小的绿色调整按钮的窗口。这可能吗?创建NSWindow的自定义子类并重写“standardWindowButton:forStyleMask:”类方法Objective c 在不显示“调整大小”按钮的情况下调整窗口大小,objective-c,cocoa,nswindow,Objective C,Cocoa,Nswindow,我希望有一个可调整大小但不在左上角显示小的绿色调整按钮的窗口。这可能吗?创建NSWindow的自定义子类并重写“standardWindowButton:forStyleMask:”类方法 @interface CustomWindow : NSWindow @end @implementation CustomWindow + (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSUInteger)styleM
@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;
}