2020-07-22 03:53 AM
Hi,
I'm trying to make an simple TouchGFX application that update a TextArea. But when i try to call, from Model::tick(), the modelListener pointer and access to the ViewPresenter function, it is not available. So i have probably misunderstanded something. I attach some code to illustratte what i say.
//In Model.cpp
void Model::tick()
{
modelListener->newTextToWrite();
}
//In Screen1Presenter.cpp
void Screen1Presenter::newTextToWrite()
{
view.updateTextArea();
}
//In Screen1View.cpp
void Screen1View::updateTextArea()
{
textArea1.setWildcard((touchgfx::Unicode::UnicodeChar*)"Geek");
}
Thanks !!
2020-07-24 12:35 AM
Hello,
If you simply want to change a TextArea, do it directly in your View.
Just implement the function void handleTickEvent() and do the changes inside. This function will be automatically called by Model::Tick().
/Alexandre