working menu validation method
This commit is contained in:
@@ -8,7 +8,15 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class StatusBarController: NSObject, NSMenuDelegate {
|
||||
class StatusBarController: NSObject, NSUserInterfaceValidations {
|
||||
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
||||
if let menuitem = item as? NSMenuItem {
|
||||
menuitem.state = .on
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@IBOutlet weak var statusBar: NSMenu!
|
||||
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||
let matchesAPI = MatchesAPI()
|
||||
|
||||
Reference in New Issue
Block a user