ParameterChange not working for buttons

I wonder if anyone can help? I’ve been stuck for hours and hours on something that should be really really simple. The component creation stuff I’ve already used in other projects, and it’s still working. But this start project is missing something I can’t figure out what, embarrasingly.

To demo it, I’ve created a basic stand alone project, with a GUI.
I’ve added 1 button and 1 slider component, with attachments to parameters.

I’m getting parameterChanged called for the slider, but not for the button, does anyone know why?

I’ve attached the simple project, thanks. It’s just 4 source files:

TestParams.zip (6.1 KB)

Projucer is setup for Windows only currently, sorry.

Is your text button toggleable? What about adding:

bt.setToggleable(true);

Thanks, yeah I tried that - It ignores the setting, doesn’t toggle at all. It just stays on false all the time, no matter what the default setting is.

buttonClicked gets called if I enable a listener for the UI. parameterChanged does not get called.

Oh, there is another one that might help:

bt.setClickingTogglesState(true);

Does buttonStateChanged also get called by the listener?

1 Like

Thanks @ zsliu98 That was it! I don’t remember setting that before. It’s been a while since I’ve started a new project. I was expecting it to work as default, I guess.