Created
March 15, 2011 02:29
-
-
Save chrislloyd/870215 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NSResponder | |
def acceptsFirstResponder= val | |
(@acceptsFirstResponder = val).tap do | |
instance_eval do | |
def acceptsFirstResponder | |
@acceptsFirstResponder | |
end | |
self | |
end | |
end | |
end | |
end | |
NSTextField.alloc.initWithFrame(...).tap {|tf| | |
tf.acceptsFirstResponder = false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems really hacky but I couldn't find a method like: