So I have a ViewContainer
defined in the GUI Editor. I added the subcontroller attribute “ButtonController” to this ViewContainer.
Within this ViewContainer
I have added a COnOffButton
.
When I click this button, I want it to respond.
Here’s the code
IController* MainController::createSubController(UTF8StringPtr _name,
const VSTGUI::IUIDescription* /*description*/,VSTGUI::VST3Editor* editor)
{
ConstString name(_name);
if (name == "ButtonController")
{
return new ButtonController(editor);
}
return nullptr;
}
Here’s the ButtonController class :
class ButtonController : public VSTGUI::DelegationController
{
public:
ButtonController(VSTGUI::IController* parent) : DelegationController(parent) {};
~ButtonController();
IControlListener* getControlListener(VSTGUI::UTF8StringPtr controlTagName) override { return this;}
void valueChanged(VSTGUI::CControl* pControl)
{
// this is not invoked on button click
}
};
I expect valueChanged
function to be invoked on button click. But it never does. What am I missing ?