Skip to content

Instantly share code, notes, and snippets.

@chrislloyd
Created March 15, 2011 02:29
Show Gist options
  • Save chrislloyd/870215 to your computer and use it in GitHub Desktop.
Save chrislloyd/870215 to your computer and use it in GitHub Desktop.
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
}
@chrislloyd
Copy link
Author

This seems really hacky but I couldn't find a method like:

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