How to load a scroll list item programmatically without predefining in TouchGFX designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-21 5: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.
- Labels:
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-21 9: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));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-21 9: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));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-21 8: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-21 10:48 PM
I mean you can create item.setLabel in string variant and in container use wildcard...
<>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-22 8:10 PM
Ahh okay. I'll try that. Thank you very much.
