title: NSTextField: end editing when user clicks outside of the text field
body: <p>I have an <code>NSTextField</code> that I'm setting editable depending on a user action. I'd like to end editing when the user clicks anywhere outside of the text field inside the window.</p>
  
  <p>Seems simple, but I could not get this to work. I implemented <code>controlTextDidEndEditing</code> and <code>textDidEndEditing</code>, but no luck, especially when I click on a user interface element that does not accept the first responder status.</p>