title: How to check if an opencv window is closed
body: <p>How do you check if an opencv window has been closed?</p>
  
  <p>I would like to do:</p>
  
  <pre><code>cvNamedWindow("main", 1);
  
  while(!cvWindowIsClosed("main"))
  {
      cvShowImage("main", myImage);   
  }
  </code></pre>
  
  <p>but these is no such cvWindowIsClosed(...) function!</p>