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
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...
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
Post a Comment