diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index bfaf890..a241c73 100755 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -308,7 +308,15 @@ void ObxdAudioProcessorEditor::addMenuButton (int x, int y, int d, const Image& 0.3f, // menu click transparency Colour()); - imageButton->addListener (this); + //imageButton->addListener (this); + imageButton->onClick = [this](){ + ImageButton *imageButton = this->imageButtons[0]; + auto x = imageButton->getScreenX(); + auto y = imageButton->getScreenY(); + auto dx = imageButton->getWidth(); + auto pos = Point (x, y + dx); + resultFromMenu (pos); + }; addAndMakeVisible (imageButton); } @@ -418,6 +426,7 @@ void ObxdAudioProcessorEditor::resultFromMenu (const Point pos) void ObxdAudioProcessorEditor::buttonClicked (Button* b) { + /* auto imageButton = dynamic_cast (b); if (imageButton == imageButtons[0]) @@ -428,7 +437,7 @@ void ObxdAudioProcessorEditor::buttonClicked (Button* b) auto pos = Point (x, y + dx); resultFromMenu (pos); - } + }*/ auto toggleButton = dynamic_cast (b);