LooPer
LooPer

Reputation: 1479

Create cocoa borderless window using nib design

I am trying a full screen borderless full screen window. I can show it but it appears empty because I don't know how to tell it to use one of my NIB files. I am using following code to create the window:

int windowLevel = CGShieldingWindowLevel();   
NSRect screenRect;
screenRect = [[NSScreen mainScreen] frame];
ventanaBloqueo = [[Escucha alloc] 
           initWithContentRect:screenRect
           styleMask:NSBorderlessWindowMask
           backing:NSBackingStoreBuffered
           defer:NO 
           screen:[NSScreen mainScreen]];

where 'Escucha' is a NSWindow subclass. How could I tell the window use one of my NIB designs?

Regards

Upvotes: 1

Views: 636

Answers (1)

lbrndnr
lbrndnr

Reputation: 3389

I would use a window controller. It's much easier and more ordered.

For example:

NSWindowControllerSubclass* controller = [[NSWindowControllerSubclass alloc] initWithNibName:@"nibName"];

Upvotes: 1

Related Questions