Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 在不显示“调整大小”按钮的情况下调整窗口大小_Objective C_Cocoa_Nswindow - Fatal编程技术网

Objective c 在不显示“调整大小”按钮的情况下调整窗口大小

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

我希望有一个可调整大小但不在左上角显示小的绿色调整按钮的窗口。这可能吗?

创建NSWindow的自定义子类并重写“standardWindowButton:forStyleMask:”类方法

@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;
}