How to change text of CTextLabel programmatically?

Hi

In my .uidesc I have this line

<view class="CTextLabel" title="TestLabel" origin="10, 10" size="80,20" transparent="true" />

The label is showing up in my plugin but how can I get a handle to it programmatically to be able to use the setText? I would like to update the text on different events within the process function.
Like for an example change the title “TestLable” to “Muted” or any other text on different events.

Is this possible and how do I do that?

Edit: It was a very long time ago that I developed VST plugins (version 1.x or something like that),
back then the GUI had isOpen and other nice things, now I’m totally lost where to begin.
Everything has changed? We are not allowed to have that deep connection to the Gui anylonger?

Is it possible to inherit from the CTextLabel class and override to create my own specials?
And then use my own custom in the <view class=“CMyOwnCustom”?

Thanks in advance

Hi,

You should probably be using
subcontrollers. They allow you to have “personal access” to one or multiple ui elements. In the beginning, it seems a little bit complicated to use them, but once you get the hang of them they are extremely powerful and flexible.

In this specific case you could query your events from the EditController to the subcontroller which stores a pointer to your label and can call its setText() function.

I hope this helps,
Greetings

PS: you can also create own gui classes and register them for usage in the WYSIWSG editor but this requires you to write a factory and this is simple but can be tedious. Examples for both techniques are used in the example plugins of the SDK (e.g. host checker and note expression synth) and in the vstgui library itself

PPS: but if you can solve it by creating a StringListParameter and changing it from the processor side this is probably much easier.

1 Like

Hello Mc-Zen

Thank you very much, you gave me alot to look into.
That was a lot to comprehend, I guess it will take a few days before I’ll succeed with it.

Kind Regards