I'm trying to remove the r开发者_如何学编程esize corner from an NSPanel HUD styles.
This is what I'm trying right now.
NSUInteger currentStyleMask = [somePanel styleMask]; [somePanel setStyleMask: currentStyleMask | !NSResizableWindowMask];
I also get a warning that NSWindow may not respond to setStyleMask and it isn't defined in NSWindow.h, however it is defined in the NSWindow documentation.
You can only set the style mask of an NSWindow
at creation time, you can't change it once the window has been instantiated.
You need to create the window programmatically and initialize it by calling -initWithContentRect:styleMask:backing:defer:
and pass in your desired style mask.
If you want to manipulate the window in Interface Builder instead of creating it programmatically, you'll need to subclass NSWindow
, override -initWithContentRect:styleMask:backing:defer:
and pass in your style mask to super
's implementation. You can then assign your subclass to the window in Interface Builder.
精彩评论