2011-12-30 52 views
0

我试图找到通知/方式来检查NSStatusBar(系统宽栏)NSStatusItem是否被点击。NSMenuBar鼠标关闭通知?

有没有人知道如何实现这个?

感谢

EDITED 20120111

我的意思是,从整个状态栏 “任何” 项目。

回答

0

做这样的事情:

statusItem.target = self; 
statusItem.action = @selector(mouseDown:); 
statusItem.sendActionOn = NSLeftMouseDownMask; // try without this at first - i can't remember what the default it so you probrably don't need it 

则:

- (void)mouseDown:(id)sender { 
    NSLog(@"click click"); 
} 
+0

对不起,我已经更新了我的问题。 – xyz 2012-01-11 08:30:52