Setting the number of items per column

In VSTGUI 3.6 i simply did call myCoptionmenu->setNbItemsPerColumn(32) on openening the editor (::open) to group rows of 32 items in list selectors (Windows).

VST SDK 3.7 now uses the .uidesc file to build the editor.

IPlugView* PLUGIN_API T2Audio::createView(const char* name)
{

viewpointer = new VSTGUI::VST3Editor(this, “view”, “FireBird.uidesc”);

How can I access the COptionmenu for a given tag to call ->setNbItemsPerColumn(32) ?
How can I access the GUI part of a knob or control in general?

Thank you,
Markus

I tried this code, but it doesn’t work. The pointer is incorrect

VSTGUI::COptionMenu mymen;
mymen = (VSTGUI::COptionMenu
)(EditController::getParameterObject(kPatchSelect));
mymen->setNbItemsPerColumn(32);

Sorry, I don’t think that you can get access to it that easy. You have to write your own controller code for it.

So it is not possible to have access to the GUI elemets which have been added to the frame?

If you like you can iterate thru all views in the frame if you like. But if you want to make this a case by case decision you should write a controller (IController) for that UI object.

Thank you Arne,

can you please give me a short code snippet how do I can iterate through the views in the frame?

Markus

nevermind. I was able to find a proper and clean solution for myself:

class MyController : public VSTGUI::IController
{
public:

MyController(IController* _parentController, T2Audio* synpointer, VSTGUI::VST3Editor* editorpointer)
{
parentController = _parentController; // — save the parent listener
syn = synpointer;
editor = editorpointer;
}


//— is called when a view is created -----
VSTGUI::CView* verifyView (VSTGUI::CView* view, const VSTGUI::UIAttributes& ,const VSTGUI::IUIDescription* ) override
{
if (VSTGUI::COptionMenu* om = dynamic_castVSTGUI::COptionMenu* (view))
{
om->setNbItemsPerColumn(32);
}
return view;
}