In Screen1View.cpp, implement the handleTickEvent() method (don't forget to declare this function also in the Screen1View.hpp file).
In Screen1View.hpp, declare a boolean variable to toggle the color of your widget (e.g. bool toggle=false), and a integer variable that you can initialize at 0 (e.g. int counter=0)
Then, in the handleTickEvent() method, you can increment your counter every time the method is called, and implement a switch case mechanism in order to toggle the color of your widget, like this:
counter++;
if(counter%60 == 0) // toggle color every second
{
toggle = !toggle;
switch(toggle)
{
case false:
box2.setColor(red);
break;
case true:
box2.setColor(blue);
break;
}
box2.invalidate();
counter=0;
}
Please note that you can change the blinking rhythm by modifying the "if(counter%60 == 0) " condition (For example : "if(counter%30 == 0)" will enable you to change the color every half second).