7 Replies
      Latest reply on Dec 8, 2018 5:44 PM by szymczyk
      advancecoder Level 1 Level 1 (0 points)
           let item1 = NSMenuItem(title: "Reset", action: Selector(("resetAlarm:")), keyEquivalent: "R")
           //item1.target = self
           item1.isEnabled = true
           let item2 = NSMenuItem(title: "Stop", action: Selector(("stopAlarm:")), keyEquivalent: "S")
           //item2.target = self
           item2.isEnabled = true
           let item3 = NSMenuItem(title: "Pause", action: Selector(("pauseAlarm:")), keyEquivalent: "P")
          // item3.target = self
           item3.isEnabled = true
           let item4 = NSMenuItem(title: "Continue", action: Selector(("continueAlarm:")), keyEquivalent: "C")
           //item4.target = self
           item4.isEnabled = true
           ContextualMenu.update()
           ContextualMenu.addItem(item1)
           ContextualMenu.addItem(item2)
           ContextualMenu.addItem(item3)
           ContextualMenu.addItem(item4)
         
           statusbar.menu = ContextualMenu
           statusbar.button?.isEnabled = true
           ContextualMenu.autoenablesItems = true
           NSApp.mainMenu?.update()

         

        Why is the contextual menu items not enabled?  Any tips...