buttonCallbackHandler not trigger if touchgfx::Button is clicked
Hello,
I'm working with STM32H7A3, STM32CubeIDE Version: 1.14.1 and TouchGFX Designer 4.23.2.
If I add a simple button to my project, when I press the button on the touch screen I see the image change but the buttonCallbackHandlerdoes not trigger, while if I add for example a toggle button the callback triggers correctly
I attach part of the code generated by TouchGFX Designer.
void Working_menuViewBase::buttonCallbackHandler(const touchgfx::AbstractButton& src)
{
if (&src== &toggleButton1)
{
//Interaction1
//When toggleButton1 clicked execute C++ code
//Execute C++ code
static int i;
i++;
}
if (&src== &button1)
{
//Interaction2
//When button1 clicked execute C++ code
//Execute C++ code
static int i;
i++;
}
}
class Working_menuViewBase : public touchgfx::View<Working_menuPresenter>
{
public:
Working_menuViewBase();
virtual ~Working_menuViewBase();
virtual void setupScreen();
protected:
FrontendApplication& application() {
return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
}
/*
* Member Declarations
*/
touchgfx::Box __background;
touchgfx::Image imgBack;
touchgfx::ToggleButton toggleButton1;
touchgfx::Button button1;
private:
/*
* Callback Declarations
*/
touchgfx::Callback<Working_menuViewBase, const touchgfx::AbstractButton&> buttonCallback;
/*
* Callback Handler Declarations
*/
void buttonCallbackHandler(const touchgfx::AbstractButton& src);
};Any suggestions?
Thank you
