Repaint component immediately


In a Button::Listener::buttonClicked( Button * ) method I want to change the state of the button before invoking a slightly time consuming action. How can I make it update immediately?

myButton->setEnabled( false );
bool actionOk = doSomethingThatCanTakeSomeTime();
if ( actionOk )
myButton->setEnabled( true );

A call to paint will merely invalidate its rectangle (I am on Windows7).
I’d like various methods that can cause a button to change state like setButtonText to cause an immediate update.

Is this possible?


You can’t. This isn’t the 1990s any more. If you need to perform a time-consuming operation, use a background thread!