Sha256: 95d85a5761e1a3f2db80bd05974b3acdee935dd0d6468e7ccb7816f8fc4f964e
Contents?: true
Size: 1.08 KB
Versions: 21
Compression:
Stored size: 1.08 KB
Contents
# @requires MotionKit::NSMenuLayout module MotionKit class NSMenuLayout ##| ##| 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
21 entries across 21 versions & 1 rubygems