0

OK, this is what I'm trying to do :

  • I have a custom NSPanel subclass
  • I want the NSPanel to be borderless (NO title - I'm drawing a titlebar myself) AND resizeable

The thing is that :

  • once I set the styleMask to NSResizableWindowMask, the default title bar appears as well.
  • once I set the styleMask to NSBorderlessWindowMask, the default title bar disappears (that's good), but the window loses its resizing ability.

This is my Code :

- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
{
    if ((self = [super initWithContentRect:contentRect styleMask:NSTitledWindowMask backing:bufferingType defer:deferCreation])) {
        [self setOpaque:NO];
        [self setBackgroundColor:[NSColor clearColor]];
        [self setMovableByWindowBackground:YES];
        [self setLevel:NSFloatingWindowLevel];
        //[self setStyleMask:[self styleMask]&~NSTitledWindowMask];
    }
    return self;
}

As you may see from the commented-out code, I've tried using any possible combination of bit operations with the mask so that I combine what I need.

Any ideas??

Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223

1 Answers1

0

Just do them at a time like this

styleMask:NSTitledWindowMask | NSResizableWindowMask 
Muke
  • 694
  • 8
  • 15