I am creating an application NSStatusBarand want to call different functions depending on whether the user clicked the icon on the left or right.
Here is what I still have:
let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
func applicationDidFinishLaunching(aNotification: NSNotification) {
let icon = NSImage(named: "statusIcon")
icon?.setTemplate(true)
statusItem.image = icon
statusItem.menu = statusMenu
}
In doing so, it displays with statusMenuevery click. How can I distinguish mouseEvents?
ixany source
share