Hello.
Please tell me how to put a StringArray in a ListBox? I looked at examples, but there is some kind of hell with XML and other incomprehensible things. I’ve already created the ListBox.
I thought there was something like:
There is no simple method to put anything in a ListBox. What is shown in a ListBox instance is determined by a ListBoxModel instance and there is no ready to use implementation in Juce included to handle a StringArray.
So, you need to make a ListBoxModel subclass that deals with your StringArray.
I’m not really sure what you mean. The list box is a concept: a proper implementation abstracts away the “what” from the “how” - in your case, text (the “what”) to be displayed.
The list box doesn’t require displaying text as it can be used to draw any number of things; in JUCE’s case this can include Components themselves, so you can customise the list to whatever you want.
If you wanted to draw an image beside the text, what would you do? Well, you wouldn’t want to be stuck with a text-only option.
Maybe the easiest option is for the JUCE devs to provide a tutorial on the website.
“Something happened”? What does that mean? It worked? It didn’t work? You got a compile error? Please let us know what it is you are trying to say here. If you need more help, let us know what the problem is that you need help with, so we don’t have to try to guess, ok?