highgui: is there a way to detect when the window is closed?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

highgui: is there a way to detect when the window is closed?

Gabriele-2
Hello,

The question is all in the object, however I'll explain a bit the
situation.
I have made a small tool where I can click and do stuff on the image,
drwaing lines and points on it. So there's a mouse callback function
and then a loop where the drawing function is called repeatedly as to
apply the changes that I input from the mouse (e.g., drawing circles
where I click).
Now, if I close the window form the "x" button, what happes is that
the system gets stuck in the loop, without actually doing anything.
Is there a way to detect when the x is pressed and therefore get out
of the loop?
I see the also the samples suffer form the same problem...

Thanks a lot in advance.