您的位置:首页 > 移动开发 > Objective-C

cocoa 点击关闭按钮退出应用程序

2013-11-20 00:00 597 查看


- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application

WebViewRadio *themWeb = [[WebViewRadio alloc]init];
[themWeb frameSkinTheme:_window];
[_window setDelegate:self];

[[_window standardWindowButton:NSWindowZoomButton] setHidden:YES];
//[[_window standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];

//[_window standardWindowButton:NSWindowCloseButton]
//[NSApp hide:_window];
//[NSApp endSheet:_window];
}
-(BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag{
NSLog(@"%hhd",flag);
[_window makeKeyAndOrderFront:nil];
return YES;
}

-(void)windowWillClose:(NSNotification *)notification{
//[NSApp terminate:self];
[NSApp hide:_window];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  cocoa objective-c xcode
相关文章推荐