2023-03-21 05:20 AM
I'm trying to load some text data into a scroll list. Those texts are generated at runtime. I want to show them as list items. Also, the number of elements is not fixed. No sharply defined upper limit and lower limit for the number of elements.
Solved! Go to Solution.
2023-03-21 09:08 AM
Simply create array for this and use it in callback
item.setIco_1(touchgfx::Bitmap(UI_Menu_Icons_1B[itemIndex]));
item.setLabel_1(touchgfx::TypedText(UI_Menu_Items_1B[itemIndex]));
ofcourse container need setter func
plus in setup or change func place
scrollList1.setNumberOfItems(sizeof(UI_Menu_Items_B));
2023-03-21 09:08 AM
Simply create array for this and use it in callback
item.setIco_1(touchgfx::Bitmap(UI_Menu_Icons_1B[itemIndex]));
item.setLabel_1(touchgfx::TypedText(UI_Menu_Items_1B[itemIndex]));
ofcourse container need setter func
plus in setup or change func place
scrollList1.setNumberOfItems(sizeof(UI_Menu_Items_B));
2023-03-21 08:33 PM
Thank you for the anwser. But what is the data types of UI_Menu_Items_1B. Isn't it a array of resouser ids of texts , defined in TouhcGFX designer. So how could I change the text from code.
Thank you
2023-03-21 10:48 PM
I mean you can create item.setLabel in string variant and in container use wildcard...
<>
2023-03-22 08:10 PM
Ahh okay. I'll try that. Thank you very much.