cancel
Showing results for 
Search instead for 
Did you mean: 

Changing ScrollWheel number of items programmatically

MuratUnal
Associate II

Hello,

I have a screen that include scrollWheel and items from a custom container. I can change Number of items from touchgfx GUI. And i can see the code behind in screenViewBase.hpp. (In this example i have 6 cumtom container items for scrollWheel)

touchgfx::DrawableListItems<menuItem, 6> scrollWheel_timeSettingsMenuListItems;
 

But i need to change number of items programmatically in run time. is it possible and what is the way of it?

Thanks and Best Regards,

Murat

3 REPLIES 3
Artur Vieira
Associate III

Hi

You can use:

scrollList1.setNumberOfItems(5);

For example, to set the number of elements to '5'.

I realize this is an old question, but I have one that is related to it. Does setNumberOfItems work()? When I call it, I get a Hard Fault. I see that it is called in my base file already, so can this function be called twice?

Artur Vieira
Associate III

Hi

In my case at least it is working, i am calling that when setting up a modal screen to adjust the size of the list. By default via designer is 7, and when calling the modal i am setting it to 14 (Too lazy to update the designer to the correct value �� )

I am still using the version 4.12.3 of TouchGfx.