1

NSStatusBar (システム全体のバー) からの NSStatusItem がクリックされたかどうかを確認する通知/方法を見つけようとしています。

誰もこれを達成する方法を知っていますか?

ありがとう

編集済み 20120111

ステータスバー全体からの「任意の」アイテムを意味しました。

4

1 に答える 1

1

次のようにします。

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");
}
于 2011-12-30T22:51:46.517 に答える