cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx: button click trigger wrong callback function

MRafa
Associate II

Hi Team,

Issue summary: when button is clicked then other button callback function getting trigger on TouchGFX simulation and same on hardware.

Hardware details: STM32F429 Disc1 board

TouchGFX version: 4.24.0

UI snip: When I click within area marked in square sky color box which is button area then kitchen callback function is triggered which is fine; but which also covers the 30% around area of Lobby. So when I click on Lobby button which is part of Kitchen button(around 30%) then  kitchen callback function is triggered. So question is how to resolve this isseu.

TouchGFX UI screenTouchGFX UI screen

Thanks 

MR

1 ACCEPTED SOLUTION

Accepted Solutions
JohanAstrup
ST Employee

Great to hear!

You can select "Best answer" to help others find the correct solution quickly.

Best regards,
Johan

View solution in original post

5 REPLIES 5
JohanAstrup
ST Employee

Hello @MRafa.

Can you share the GUI part of your project (.touchgfx file, assets folder, and GUI folder)?

Without seeing your project, I cannot know for sure, but it sounds like the actual button is larger than targeted. This could e.g. be due to the gradient being embedded in the image asset for the button, which would increase the button size, or if you are using a flex button.
By default, TouchGFX only handles one button event each tick for a clicked coordinate. If the right button overlaps the middle button and is placed above it, only the right button will receive the event and hence trigger a callback.

Best regards,
Johan

Hi @JohanAstrup ,

I have attached my project here for further investigation. 

Regards

MR

JohanAstrup
ST Employee

The issue in your project is due to the image assets used for the buttons having a large gradient. The assets you use have a size of 128 x 116 px, which is directly determining the button size in TouchGFX.

The solution is to use different assets for the buttons, or to modify the assets you already use to decrease the size.

Best regards,
Johan

 

Hi @JohanAstrup ,

Thanks for quick reply; after resizing to 86 x 86 px. Now it is working as expected.

Thanks once again, you can close this thread.

Regards

MR

JohanAstrup
ST Employee

Great to hear!

You can select "Best answer" to help others find the correct solution quickly.

Best regards,
Johan