cancel
Showing results for 
Search instead for 
Did you mean: 

How to load a scroll list item programmatically without predefining in TouchGFX designer

CAbey.1
Associate II

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.

0693W00000aJPQaQAO.png 

This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief III

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));

View solution in original post

4 REPLIES 4
MM..1
Chief III

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));

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

I mean you can create item.setLabel in string variant and in container use wildcard...

<>

Ahh okay. I'll try that. Thank you very much.