cancel
Showing results for 
Search instead for 
Did you mean: 

TextArea won't invalidate properly (Shows old text as well as new).

iw2lsi
Associate II

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

16 REPLIES 16

Please do share your project.

Thanks!

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)

iw2lsi
Associate II

Hi Martin...

you are right! by removing the 1st iteraction everything works as expected.

thanks for your great support!

Giampaolo

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.

iw2lsi
Associate II

fixed!

thanks again,

Giampaolo

No problem! Thanks for reporting it - It rekindled the discussion about allowing users to fade certain elements 🙂

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.