BooleanPropertyComponent Listener?


#1

Hi Everyone,
how exactly should I get a feedback on whether the property has changed? For example TextPropertyComponent has it’s own Listener but BooleanPropertyComponent has nothing like that. It has only some method call buttonClicked which I guess can be used in this way but it requires subclassing the BooleanPropertyComponent which is not very user friendly. But the thing is that the function lacks any documentation and looking at the code I can see that it is used to toggle the state so while subclassing I also need to call the original method. Now that’s not that much of a problem but it makes me wonder how you intended the class to be used in the first place.

Thanks!


#2

Well it’s been a while but I am going to pop this up… Still have no answer. As I said, I can subclass it but hey - that’s not the common JUCE user friendly way… How are you supposed to get a feedback from BooleanPropertyComponent?

Thanks


#3

If you connect the component to a Value, then you can add other listeners to the Value itself. That’s the cleanest way of doing it.


#4

Nice!

I had no idea Value had it’s listener. I would even say it didn’t some time ago. Anyway after implementing this, I found out that I don’t need the listener at all. Guess why - because I needed it to update the value :slight_smile:

Thanks Jules!