1
我希望呈現一個視圖時,點擊狀態欄項目是這樣的:彈出一個瀏覽時點擊狀態欄項目
而且我已經設置了StatusItem
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var imageManager: NSMenu!
let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
func applicationDidFinishLaunching(aNotification: NSNotification) {
let icon = NSImage(named: "statusIcon")
icon?.template = true
statusItem.image = icon
statusItem.menu = imageManager
statusItem.action = nil
}
我應該怎麼做?