2020-04-16 07:38 PM
In order to implement my ui component more independently, I design it this way.
// subclass of container
MyComponent::MyComponent()
{
// init some ui
// ...
Application::getInstance()->registerTimerWidget(this);
}
MyComponent::~MyComponent()
{
Application::getInstance()->unregisterTimerWidget(this);
}
void MyComponent::handleTickEvent()
{
if(backend_data_dirty){
backend_data_dirty = 0;
// update some ui
}
}
I have designed some components this way, and can run smoothly. So I avoided use touchgfx's model and presenter completely.
But recently, when more and more ui put together, program always crashed at FrontendApplication.hpp
virtual void handleTickEvent()
{
model.tick();
FrontendApplicationBase::handleTickEvent();
}
As no source code suplied, I have no way to debug it.
2020-04-17 05:10 PM
The problems of touchgfx's model and presenter is, it runs at Screen level, not component level.
So if I have 10s or more components in a screen, all these backend data should go through one model/presenter of a screen, It is difficult to maintain later.
And if a same component which needs polling backecd data is used in another screen, I have to do it again.
Hope someone can help to make this component level model work.
2020-04-20 07:36 AM
I don't really see this as a "problem". And i'm not really sure what you mean by "i have to do it again".
/Martin