cancel
Showing results for 
Search instead for 
Did you mean: 

Why are all event callback parameters declared "const"? how do I alter UI from events?

nkash.5
Associate

For instance "void textAreaClickHandler(const TextAreaWithOneWildcard& area, const ClickEvent& event);"

I would like to alter UI controls from callbacks but "const" seem to tell me that that's against some big picture idea of TGFX? What concept am I missing? I've looked at documentation and did not see anything very focused on event paradigm.

3 REPLIES 3
MM..1
Chief II

Simply this & is addr to objects and need protect to overwrite. But you can call methods for change this objects properties free...

C:/Work/T4sest/est1/TouchGFX/gui/src/screen1_screen/Screen1View.cpp:60:21: error: passing 'const touchgfx::TextAreaWithOneWildcard' as 'this' argument discards qualifiers [-fpermissive]

  60 |     b.setAlpha(1);

Show code

...