title: OpenCV closing a window with a mouse click on a Raspberry Pi
body: <p>What I want to do is, I want to have have a user click the close &quot;X&quot; button in an OpenCV window and have the program recognize it, and close that window.</p>
  <p>It seems that this is not easy, and after four days of going round in circles and finding out how it can be done on a windows machine I am no closer to finding out how to do it on a Raspberry Pi using Python.</p>
  <p>I think I need to get the handle of the OpenCV window ( how? ) and then use that to see if the window is still visible ( what call? ) and if it is not, bring proceedings to a halt ( I can do that bit ).</p>
  <p>I have tried cvGetWindowHandle(&quot;window_name&quot;) but I've downloaded the source and GetWindowHandle doesn't seem to be available from python.</p>