开发者

Create cocoa borderless window using nib design

开发者 https://www.devze.com 2023-02-20 01:38 出处:网络
I am trying a full screen borderless full screen window. I can show it but it appears empty because开发者_如何学C I don\'t know how to tell it to use one of my NIB files. I am using following code to

I am trying a full screen borderless full screen window. I can show it but it appears empty because开发者_如何学C 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


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

For example:

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

精彩评论

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