views:

39

answers:

1

I'm trying to remove the resize 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.

A: 

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.

Rob Keniger