Clear console text even when we close it with ESC key

This commit is contained in:
David Capello 2018-11-26 16:02:50 -03:00
parent 865e0d7ee6
commit 23059c6309

View File

@ -72,11 +72,13 @@ Console::Console(Context* ctx)
// The "button" closes the console
button->processMnemonicFromText();
button->Click.connect(
button->Click.connect(base::Bind<void>(&Window::closeWindow, window, button));
// When the window is closed, we clear the text
window->Close.connect(
base::Bind<void>(
[window, button, textbox] {
[textbox] {
textbox->setText(std::string());
window->closeWindow(button);
}));
view->attachToView(textbox);