2025-11-17 4:37 AM
one box in the screen, then create a button on box, meant to change the color of box, when button pressed; simulator -> OK; but download to board, running denormal , when button pressed, finger off, button not release, still pressed state, why? (use STM32F429I_DISCO BOARD CUBEIDE)
Solved! Go to Solution.
2025-11-22 9:33 PM
just make a test!
2025-11-18 12:25 AM
Hello @redstone8415.
Can you share your project? I just did a quick test, and I do not see any issues.
Best regards,
Johan
2025-11-19 12:04 AM
the problem is solved,
box1.setColor(touchgfx::Color::getColorFromRGB(rand()&0xff, rand()&0xff, rand()&0xff)); here to blocking!
to comment out, button is normal!
correction method:
void Screen1View::buttonClicked()
{
static uint32_t counter = 0;
counter++;
// Direct color composition (avoids function call)
uint32_t r = (counter * 13) & 0xFF;
uint32_t g = (counter * 37) & 0xFF;
uint32_t b = (counter * 71) & 0xFF;
touchgfx::colortype newColor = (r << 16) | (g << 8) | b;
box1.setColor(newColor);
box1.invalidate();
}
2025-11-19 12:15 AM
Okay, great to hear!
Is there a reason why you do not use a flex button? Using a flex button allows embedding the box and click functionality within a single widget.
Best regards,
Johan
2025-11-22 9:33 PM
just make a test!