Skip to main content
MuratUnal
Associate II
November 25, 2019
Question

Changing ScrollWheel number of items programmatically

  • November 25, 2019
  • 3 replies
  • 1230 views

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

This topic has been closed for replies.

3 replies

Artur Vieira
Associate III
November 26, 2019

Hi

You can use:

scrollList1.setNumberOfItems(5);

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

scottSD
Senior III
September 18, 2020

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
September 22, 2020

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 :grinning_face_with_sweat: )

I am still using the version 4.12.3 of TouchGfx.