Message system in JUCE question


#1

Hi there,

I’m in the process of writing an application with JUCE and I’m trying to wrap my head around it’s message system. Please excuse me, I’m very much used to programming with Qt using slots and signals.

Basically I have a component that contains a listbox and I want to change a bunch of other things in the component depending on what is currently selected in the listbox. I’ve got as far as using the ‘selectedRowsChanged’ method but I was wondering if there was a nice way of letting other components know things have changed.

Thanks!

Great GUI by the way, more friendly than Qt (especially the forum!).


#2

Thanks. You know, it’s odd that I’ve never done a ListBoxListener class… that’d probably be quite handy…

In the meantime, what I’d do would be to create a ChangeBroadcaster that listeners can register with, and then in your selectedRowsChanged() method, just call its sendChangeMessage() method to ping them all.


#3

Thanks Jules,

It was the lack of a ListBoxListener class that made me think I was missing something. Using ChangeBroadcaster will be fine.

Matt.


#4