Sha256: 82822c7070f0fcf257633abd1b067117cc3cb9fee31d1ecc727cca8acc1a336c
Contents?: true
Size: 1.08 KB
Versions: 15
Compression:
Stored size: 1.08 KB
Contents
# @requires MotionKit::NSMenuHelpers module MotionKit class NSMenuHelpers ##| ##| These methods are meant to be called on the parent menu item, but ##| there's no way to reference an NSMenu's parent *item* (only its parent ##| *menu*). So the @menu_item is stored in an ivar before the menu block ##| is created, and these methods access that menu item. ##| # sets the title of the current NSMenu AND it's parent NSMenuItem def title(value) target.title = value @menu_item.title = value end def attributedTitle(value) target.title = value.to_s @menu_item.attributedTitle = value end def attributed_title(value) target.title = value.to_s @menu_item.attributedTitle = value end def state(value) @menu_item.state = value end def tag(value) @menu_item.tag = value end def keyEquivalentModifierMask(value) @menu_item.keyEquivalentModifierMask = value end def key_equivalent_modifier_mask(value) @menu_item.keyEquivalentModifierMask = value end end end
Version data entries
15 entries across 15 versions & 1 rubygems