Hide-able Labels

Hi everyone,

I am trying to create labels that I can hide with a button. An example of code I have so far in my PluginEditor.cpp is


For some reason, the setVisible will only accept the default state of the button, and will not listen to the changes. I know that the textbutton works with other switches I have in my design. I’m guessing that I am not communicating the value of LAB_IN_ID properly.

Thanks for your help,

Do you really want to have the visibility of the label automated from the host automation?
You should rather use a simple bool variable.

If you want that selection persistent, you can store it in the ValueTree state, that is exposed by your AudioProcessorValueTreeState apvts.

1 Like

Gotcha. I was trying to create a hide/show function for the labels. I tried a bunch of different things, It looks like I can get the initial bool value to show or hide the label, but it won’t seem to update when I click the text button. Do you know why that would be?