2019-02-01 08:42 AM
Hi...
I'm trying to update the contents of a textArea from a freeRTOS task but I have a problem on the second iteration... it seems that the new text is written on top of the old ones... even if I call the Invalidate() methods as reported below:
void Screen1View::setMessage(char* message, int msglen)
{
textArea1.invalidate();
Unicode::strncpy(textArea1Buffer, message, msglen);
textArea1.setWildcard(textArea1Buffer);
textArea1.resizeToCurrentText();
textArea1.invalidate();
}
why is this happening ? shouldnt invalidate() do all the magics ?
thanks a lot,
Giampaolo
Solved! Go to Solution.
2019-02-04 04:27 AM
Please do share your project.
Thanks!
2019-02-04 06:02 AM
Hi,
I found the problem. Try deleting interaction1 - It fades image1 (background) to 0 alpha, so essentially you have no background when you try to render text on top. The background image isn't updated properly on the canvas by the interaction because the framebuffer is immediately beneath it (there is nothing to blend with) - so that might have confused you. Once you've done that, you will now see the problem with "resizeToCurrentText" that we discussed previously.
But essentially you're using texts with wildcards in the right way (except for your resizing issue)
2019-02-04 06:12 AM
Hi Martin...
you are right! by removing the 1st iteraction everything works as expected.
thanks for your great support!
Giampaolo
2019-02-04 06:19 AM
No problem! You probably forgot that you wanted to fade the image - I've just talked with the team and we may add a default background color to any new application or disallow the element just on top of the framebuffer to be faded.
Another note: In your code you had set the wildcard on textArea1 again in your concrete view. That's unnecessary since it's already done by the generated base view. You only want to set the wildcard buffer again in case you want to switch from the default one.
2019-02-04 06:34 AM
fixed!
thanks again,
Giampaolo
2019-02-04 06:46 AM
No problem! Thanks for reporting it - It rekindled the discussion about allowing users to fade certain elements :)
2019-02-04 10:18 AM
One last thing. Try pressing F2 while in the simulator - It will enter a mode where it blinks the rects that are invalidated. It can sometimes give you an idea of what's going on.