How to access a VSTGUI control programmatically?

The WYSIWYG editor for VSTGUI 4 works decent. I have integrated this out-of-the-box with the project generator app.

My only problem is, what to do, when I want to access a control from code? Where do the CControl objects live that I have defined in the *.uidesc JSON file?

I have seen that maybe sub-controllers give fine control, but it’s not clear how to set / register this to get hold on the view object.

I can create my own custom view with a factory, sure, but I was expecting something like this:

UIViewFactory->getViewById(someUniqueIDOrName) which will then provide the control for further updates. But it seems such thing does not exist?

What is the best approach to set a CTextLabel in VSTGUI editor and then updating the label’s text from code? How a developer can access the CTextLabel object: It seems to live somewhere, but I do not know where, so I’ll probably have to end up by creating a custom view inheriting CTextLabel - instead.

See here for an example on how to create sub-controllers.

1 Like