Skip to main content
Zui
Senior
June 22, 2020
Question

How to access to a model variable from a custom class.

  • June 22, 2020
  • 1 reply
  • 615 views

I have a custom class doing stuff, it's not made from touchGFX , so it doesn't have a presenter for comunicating with the model.

i need to read a value from a structure in the model.

Tnx

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
June 24, 2020

Does it need to have that direction? Usually you'd just update the class via the Model::tick() or modelListener interface when something happens, or update it once a presenter becomes active . E.g.

void MyPresenter::activate()
{
 myClass.set(model.get());
}