I want to add a box dynamically on a button click in the buttoncallbackhandler() function.
So I tried creating a box in the buttoncallback function as follows :
touchgfx::Box * box_temp = new touchgfx::Box();
box_temp->setPosition(170,180,500,220);
box_temp->setColor(touchgfx::Color::getColorFrom24BitRGB(255,255,255));
box_temp->setVisible(true);
add(*box_temp);
box_temp->invalidate();
but on pressing the button the app freezes.
When tried to debug on trying to allocate memory using new the control reaches on
hardfault_handler(){}
Any suggestions?
