Skip to main content
Woula
Associate II
July 22, 2020
Question

TouchGFX modelListener handling in Model::tick()

  • July 22, 2020
  • 1 reply
  • 1177 views

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 !!

This topic has been closed for replies.

1 reply

Alexandre RENOUX
Visitor II
July 24, 2020

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