UIViewSwitchContainer

Hi all,

Is there a known bug with using a UIViewSwitchContainer? I cannot get any changes to persist in the editor, No matter I do.

Any templates added to the container will be forgotten once clicked away from it.

The resulting XML file seems to be correct but that is not reflected in the editor.

Been pulling my hair out over this.

I hate to bump my own thread, but the only way I can see around this is to create the UI without using the editor.

Any help would be amazing.

Hi,
can you post the xml ?

Cheers
Arne

Hi Arne,

Thank you for looking at this.

I’ve attached the XML file. If I click away from the switchviewcontainer template and save, the resulting XML will be different.

Thanks
Oli

Hi Oli,
I think with the version you have, you cannot inline edit the templates in the UIViewSwitchContainer, you have to edit the template directly.
If you check out the latest sources from github, then this should work.

I hope this helps.

Cheers
Arne

Thanks for the swift reply, Arne.

That XML was generated with the latest VST3 SDK 3.6.8. Is the VSTGUI4 repo more recent?

Thanks
Oli

Also,

Is there any documentation for writing raw XML? I think I can get the gist for most of it, but not sure if there is any control/view specific stuff.

Oli

No, that version should be ok.
Have you tried to edit the templates directly, not embedded into the switch container ?
That at least should work.

Look it up in the documentation. It may not be 100% up to date tho.

Arne,

Thanks for the info.

I can edit the individual templates fine, however, they fail to persist (or work) when placed within the switchviewcontainer.

Oli

OK, can you describe a bit more in detail what you want to achieve and what exactly is failing ?
I use it all the time without issue.

Cheers
Arne

Thanks for your help, Arne.

I have two templates that I want to show in succession, one after the other.

My understanding is a switch view would allow me to switch between the templates with a control? Individually, my two templates work correctly with their own sub-controllers, no issues there.

I’ve had absolutely no luck in getting either template to show in the template containing a SwitchContainer.

If I add the templates to the SwitchContainer they don’t persist (as mentioned before, I have added them to the XML as well, but didn’t work for me either).

I have attached a screenshot of my UIViewSwitchContainer settings in the editor.



I have worked on many VST2.4/3 projects before but never with the new VSTGUI. Not sure where I’m going wrong.

Thanks again
Oli

That is right, what I’m missing in your XML and the screenshot is the control that should switch between the templates.
Without it, it does not work.

I really hate to drag this out but I have tried everything I can think of, including adding a control for switching.

Regardless of what I try, I end up with a blank editor view with a black background.

Here is my XML file again, with the control switch. I’ve disabled all the sub-controllers for simplicity, it doesn’t work with those enabled anyway.



And the result:


This was supposed to be a 5-minute project but this little hiccup has stretched it out for weeks.

Thank you for your patience.

Oli

The problem is, that the switch control is a sub view of the switch container. That cannot work as the switch container will always replace its children with the contents of the templates.

Oh good god, it works!!!

Thank you so much, Arne.