class NSMenuItem
Attributes
commands[R]
Public Instance Methods
runBlock(sender)
click to toggle source
# File lib/everyday-menu/menu_item.rb, line 203 def runBlock(sender) @commands.execute(sender) unless @commands.nil? end
subscribe(parent, label, command_id = nil, &block)
click to toggle source
# File lib/everyday-menu/menu_item.rb, line 188 def subscribe(parent, label, command_id = nil, &block) @commands ||= parent.commands command = parent.commands.add command_id, &block self.enabled = parent.commands.canExecute unless @boundEnabled @boundEnabled = true self.bind(NSEnabledBinding, toObject: self.commands, withKeyPath: 'canExecute', options: nil) end return command if (self.target = self && self.action == :'runBlocks:') @original_target = self.target self.target = self self.action = :'runBlock:' command end