Class: NSToolbarItem
- Inherits:
-
Object
- Object
- NSToolbarItem
- Defined in:
- lib/bean/nstoolbaritem_additions.rb
Overview
Extensions to the NSToolbarItem class
Class Method Summary collapse
Instance Method Summary collapse
-
#on_click(&blk) ⇒ Nil
Shortcut for adding an on click handler to the toolbar item.
Class Method Details
.performAction(sender) ⇒ Object
12 |
# File 'lib/bean/nstoolbaritem_additions.rb', line 12 def self.performAction(sender); @on_action.call(sender); end |
Instance Method Details
#on_click(&blk) ⇒ Nil
Shortcut for adding an on click handler to the toolbar item.
The provided block will be provided the sender when executed.
10 11 12 13 14 15 |
# File 'lib/bean/nstoolbaritem_additions.rb', line 10 def on_click(&blk) @on_action = blk def self.performAction(sender); @on_action.call(sender); end setAction("performAction:") setTarget(self) end |