添加到OS X状态托盘
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了添加到OS X状态托盘相关的知识,希望对你有一定的参考价值。
NSStatusItem *trayItem; } @end @implementation Tray - (IBAction)testAction:(id)sender; { NSLog(@"Hello World"); } - (IBAction)quitAction:(id)sender; { [NSApp terminate:sender]; } { NSMenuItem *item; item = [menu addItemWithTitle:@"Testing" action:@selector(testAction:) keyEquivalent:@""]; [item setTarget:self]; item = [menu addItemWithTitle:@"Quit" action:@selector(quitAction:) keyEquivalent:@""]; [item setTarget:self]; [trayItem setMenu:menu]; [trayItem setHighlightMode:YES]; [trayItem setTitle:@"HERE"]; } - (void)dealloc; { [trayItem release]; [super dealloc]; } @end
以上是关于添加到OS X状态托盘的主要内容,如果未能解决你的问题,请参考以下文章