cancel
Showing results for 
Search instead for 
Did you mean: 

How to share string text across different screens and update textarea wildcard

JPabl.1
Senior

Hi there Touchgfx team!

 

I have a header that contains a textarea "date" acrros different screens. The idea is that the model reads the "date" from the backend RTC and expose the get/set methods, for all screens to read it.

I created this in my model: 

 

const char* get_date() const
{
return date;
}
const char *date = "MON 01 / 01:23 AM";

 

I can confirm the "date" arrives correctly to other screens by using touchgfx_printf. The problem is that once I try to update the textarea wildcard it appears as a "?" in the real screen. The ranges wildcards are ok. 

Also, since this date its not const, I think I will need a string but I'm not sure how to implement it on Touchgfx. 

 

Thanks a lot in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, I was using the textarea.setWildcard but decided to directly use the buffer like this 

Unicode::strncpy(header_date_textBuffer, presenter->get_date(), HEADER_DATE_TEXT_SIZE);

It works now 

View solution in original post

2 REPLIES 2
LouisB
ST Employee

Hello again @JPabl.1,

How do you set the data to the textArea ?

BR,

Louis BOUDO
ST Software Developer | TouchGFX

Hi, I was using the textarea.setWildcard but decided to directly use the buffer like this 

Unicode::strncpy(header_date_textBuffer, presenter->get_date(), HEADER_DATE_TEXT_SIZE);

It works now