cancel
Showing results for 
Search instead for 
Did you mean: 

How to highlight part of text in TextArea widget using TouchGFX with other color?

hdmi87
Associate II

I need a widget that contains text with black characters on white background, and some of characters inverted - white on black background (like on attached image). How is it possible to do this with TouchGFX library?

2 REPLIES 2
Martin KJELDSEN
Chief III

Sounds like a custom widget where you, besides drawing the text. take a lock on the framebuffer and invert the pixels for the characters you need. But you cannot access a text like that so you'll have to calculate where from and where to you would like to do this inversion of pixels (e.g. read white? write black, and vice versa).

/Martin

One possible way to determine where the highlighted part of text is is to use ListLayout and split TextArea into three separate TextAreas: the first - for text before highlighted piece, the second - for the highlighted part, and the third - for the remaining text.