Skip to main content
Visitor II
December 13, 2023
Question

Adding new CustomContainer to ScrollWheel

  • December 13, 2023
  • 1 reply
  • 777 views

Hello,
I need help how to add new customcontainer to scrollwheel dynamically.


First I created customcontainer named MenuElement, add TextArea named textItem and Button named buttonRemove to it.


Second I add to screen (menuScreen) scrollwheel element with propertis : Number of elements = 0 and Initial Selected Item = -1, ItemTemplate = MenuElement.

In code I want when button is clicked to call function(interaction to call new virtual function) which will add new item(MenuElement) to scrollwheel and set it to next index of existing MenuElements in scrollwheel.


Screenshot_2.png

This topic has been closed for replies.

1 reply

ST Employee
December 19, 2023

Hello @masterML5 ,
I suggest you using a List Layout instead of Scroll Wheel because it would be easier to add an item to it dynamically. There is a List Layout example in TouchGFX that implements a functionality similar to the one you are looking for. You can read more about List Layout and the example here 

I hope this helps you