-
Hello,
How can I make Action's when Windows/Dialogs are closed ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
That's because the However, you must take into account that the void handleEvent(TEvent & event ){
// Handle cmClose first to override the handling in TWindow.
if (event.what == evCommand && event.message.command == cmClose)
{
messageBox("blaa blaa",mfInformation|mfOKButton);
clearEvent(event);
close();
// Don't do anything after close().
return;
}
TWindow::handleEvent( event );
// Handle other events...
} |
Beta Was this translation helpful? Give feedback.
-
Or even better, override the void close() override {
messageBox("blaa blaa",mfInformation|mfOKButton);
TWindow::close();
} Then you won't have to do anything special in your |
Beta Was this translation helpful? Give feedback.
-
Thank You. |
Beta Was this translation helpful? Give feedback.
That's because the
cmClose
command is also handled byTWindow::eventHandle
. So, in this case, you should check for thecmClose
command before callingTWindow::eventHandle
.However, you must take into account that the
close()
method destroys the current object, so you must make sure that you do not interact with it after callingclose()
: do not callclearEvent
norTWindow::handleEvent
if you calledclose()
. For example: