I am having difficulty creating an NSPanel of type HUD, similar to that used in the VLC equalizer ( here). To get started, I want to see a panel with a closed button and title. This is the code I'm trying to use to achieve
- (IBAction)buttonTapped:(id)sender { NSPanel *panel = [[NSPanel alloc] initWithContentRect:NSMakeRect(200.0, 200.0, 300, 200) styleMask:NSHUDWindowMask | NSClosableWindowMask | NSTitledWindowMask backing:NSBackingStoreBuffered defer:YES]; [panel makeKeyAndOrderFront:nil]; }
NSHUDWindowMask parameter obviously works, I get a gray window. But the NSClosableWindowMask parameter does not seem to do anything (without the close button), and NSTitledWindowMask causes the following runtime error:
Window styleMask 0x2003 is not supported for the Heads Up Display window
As far as I can tell from the documentation , this mask combination should be allowed. I tried this with OS X 10.7 and 10.8 sdks. Does anyone know how to achieve this style window along with the close / title buttons?
source share