In my paint()
function I have:
std::cout << "paint\n";
And in my resized()
I have:
std::cout << "resized\n";
As soon as I launch (in standalone mode), std output is as follows:
resized
paint
Then there is a short pause, after which paint
is printed continuously without ceasing, like so:
paint
paint
paint
paint
paint
As soon as I resize, I get this again:
resized
paint
But then it stays there, and doesn’t print paint
continuously like it did before. What explains this behavior?
What keeps calling paint()
over and over, even though I’m not doing anything? And then why does it stop once I resize?