开发者

How can I remove the resize corner from an NSPanel that is an HUD Window

开发者 https://www.devze.com 2022-12-20 03:04 出处:网络
I\'m trying to remove the r开发者_如何学编程esize corner from an NSPanel HUD styles. This is what I\'m trying right now.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消