objective c - how to close a NSWindowController without close button by using a custom shortcut without Xcode -


i have nswindowcontroller closes pressing 'x' key , works great

enter image description here

as see, clear window, code

-(void)keydown:(nsevent *)theevent{      //if key x closes window     if ([theevent.characters.uppercasestring isequaltostring:@"x"]) {         [self.window performclose:self];     } } 

but when remove titlebar or close control stops working...

enter image description here

i want way because required have windows without buttons, close or task shortcuts , commands, in case x button close, how perform in nswindowcontroller without close control or titlebar

thanks support

with this:

-(void)keydown:(nsevent *)theevent{      //if key x closes window     if ([theevent.characters.uppercasestring isequaltostring:@"x"]) {         [self close];     } } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -