Skip to main content
JPabl.1
Associate III
October 17, 2024
Solved

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

  • October 17, 2024
  • 1 reply
  • 726 views

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

Best answer by JPabl.1

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 

1 reply

ST Employee
October 18, 2024

Hello again @JPabl.1,

How do you set the data to the textArea ?

BR,

JPabl.1
JPabl.1AuthorBest answer
Associate III
October 18, 2024

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