title: Open and close NSWindow with NSButton through NSWindowController?
body: <p>I've got a custom NSButton that I'm actually sticking in an NSStatusItem. When the NSButton is clicked, it launches my window. When the NSButton is clicked again, the window should close.</p>
  
  <p>If the window is open, it appears as if the NSButton stops responding (or doesn't receive) click events! Here's the relevant code:</p>
  
  <pre><code>[statusItem setView:myCustomButton];
  [myCustomButton setAction:@selector(showWindow:)];
  
  - (void)showWindow:(id)sender {
      if(!myWindowController) {
          myWindowController = [[MyWindowController alloc] initWithWindowNibName:@"MyWindow"];
      }
  
      [myWindowController showWindow:statusItem];
      [myWindowController.window orderFront:nil];
  }
  </code></pre>
  
  <p>Am I doing something crazy? If I set a breakpoint in the above, it is hit when the button is clicked the first time but is not hit when the button is clicked again. </p>