cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX modelListener handling in Model::tick()

Woula
Associate II

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

1 REPLY 1
Alexandre RENOUX
Principal

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