title: NSTextField not noticing lost focus on NSWindow close
body: <p>I have several NSTextField that are used on a dialog created as an NSWindow and which is displayed via:</p>
  
  <pre><code>[NSApp runModalForWindow:dialog]
  </code></pre>
  
  <p>My problem is that if a user clicks in the <code>NSTextField</code>, edits the value and then clicks the dialogs DONE button which closes the dialog via:</p>
  
  <pre><code>[NSApp stopModal]
  </code></pre>
  
  <p>The <code>NSTextField</code> doesn't get any of the delegate methods indicating editing will end or has ended and the value is not persisted. 
  I would rather not persist the values continuously  in:</p>
  
  <pre><code>controlTextDidChange:aNotification
  </code></pre>
  
  <p>I'm not clear why if the NSTextField has firstResponder status given that it is being edited, and then loses it, why it doesn't get any delegate methods. Is there some other way to detect this.</p>