How to add a ToolbarButton correctly?

gui

#1

I want to add a ToolbarButton in my mainComponent, so, I can click it to set the values of the textEditor which shows in the mainComponent. However,I still can’t create/add it correctly though I had see some steps to add the ToolbarButton like:Example Toolbar with buttons and popup menu.
I tried to add it according the descriptions, but the following errors were prompted:


Unable to open source file;

The ButtonListerner does not a class or structure name.
Can anyone tell me where I did wrong or other way to make it?
Thanks in advance.


#2

There’s something wrong with your ToolBarWorker.h

Maybe it’s missing a closing }?

Also, look at the docs for the Button class to find out why ButtonListener doesn’t work.
https://docs.juce.com/master/classButton.html


#3

You should inherit from Button::Listener. The ButtonListener typedef (without the colons) is no longer available.


#4

Ok, thank you very much.:grinning:


#5

Ok, thank you, I will check the ToolBarWorker.h.:smile: