cancel
Showing results for 
Search instead for 
Did you mean: 

Touch detection in scrollist item.

ShivDesh
Associate III

Hello All,

I am new to touchgfx and looking to implement something where a array of structure containing name and other parameters to display. I need to display parameters on selection of the names displayed.

ShivDesh_0-1747647231509.png

 

I have a   created a container and able to update the parameter names to the textarea of scrollist as in picture.

Now i need to implement a way where user can select any one Preset name and those corresponding parameters should load to the respective area. as in image attached.

 

Just let me know the way to do it will try out things as suggested.

3 REPLIES 3
GaetanGodart
ST Employee

Hello @ShivDesh ,

 

Now that you have your scroll list, all you have left to do is to execute code when an element is pressed.

You can do that with the setitempressedcallback function.*

You can see how to do that in this tutorial or in the scrollList example :

GaetanGodart_0-1747651514887.png

 

Regards,

 

Gaetan Godart
Software engineer at ST (TouchGFX)

Hello @GaetanGodart ,

 

Thanks for the quick reply,

I am using scroll list for displaying the Names, tried to go through the link you send but still it's not clear if the (setitempressedcallback) can be used for Scroll list, for scroll wheel it can be used.

if you could please explain or provide any example for scroll list items to detect press, I can try to do same and update you.

 

Regards,

Shiv

 

In the scrollList and scrollWheel example, we do update the image when we press one of the scrollList item.

I think this is this part of the code:

GaetanGodart_0-1747657815915.png

Basically, just use the setItemPressedCallback, create a handler for it and then a switch case.

 

This is also what we do in the tutorial I shared but in the tutorial we use a scrollWheel (this is basically the same).

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)