cancel
Showing results for 
Search instead for 
Did you mean: 

change ScrollWheel's content dynamicaly

shark
Senior

When screen initializes:

  scrollWheel1.setNumberOfItems(1);

  scrollWheel1.setDrawables(scrollWheel1ListItems, updateItemCallback,

 scrollWheel1SelectedListItems, updateItemCallback);

After run for some time, scrollWheel is re-configed as:

scrollWheel1.setNumberOfItems(9); // assert() error happened here

scrollWheel1.invalidate();

The error happens at :

ScrollWheelWithSelectionStyle::setNumberOfItems()

 ScrollBase::setNumberOfItems()

DrawableList::setNumberOfItems()

DrawableList::refreshDrawables()

    Container::add(*drawable);

assert(d.parent == 0 && "Cannot add Drawable multiple times");

So can I call setNumberOfItems() dynamically? How to go around?

4 REPLIES 4
Alexandre RENOUX
Principal

Hello,

You cannot change ScrollWheel content (add or remove items) dynamically like this. Actually, the current ScrollWheel is not really meant to have items removed or added.

To do so, a ListLayout without a Scrollable container should be easier to implement. Nevertheless, I will see if I have time to create a sort of Scroll Wheel where items can be added and removed more easily.

/Alexandre

scottSD
Senior III

@Alexandre RENOUX​ 

I may be interested in this as well. I have been able to change the ScrollWheel content (the strings that make up the elements of the list), but might be interested in also being able to add and remove items to change the size of the list.

Any update on this, @Alexandre RENOUX? Would really love to have a dynamically changeable scroll wheel (in terms of the items in the list.) I have a work around that *almost* works, but there are some quirks with modifying the items in the list. Would be nice to not have to actually work around it and change the contents of the scroll wheel.

Hi @Alexandre RENOUX ,

Wondering if there is any news on this dynamic Scroll Wheel.