How to insert a listbox using Jucer?


How do I insert a ListBox widget using Jucer?

I see many other widget types, such as slider, label, group box, etc. But I don’t see listbox.

I’m using JUCE v2.0.36.


If it’s not on the list, then support for that class was never added. You can use a generic component though, and set its type to ListBox.


I’m not sure I follow. I added a generic component, and I see the constructor Jucer generates does this:

    addAndMakeVisible (lbTest = new Component());
    lbTest->setName ("testing");

What I was expecting is something along the lines of [color=#008000]//[Constructor][/color] near the top of the constructor so I can insert a “lbTest = new ListBox”, and then let the rest of the generated constructor take care of placing it in the correct location, etc. But the user-specified [color=#008000]//[Constructor][/color] isn’t until the very bottom of the generated constructor.

Which brings me back to your comment. What do you mean by “set its type”?


There’s a property field for setting the type of the component that it creates - you can put your own class name in there.