Using multiple xml files

As part of my degree I have created multiple GUI’s for a plugin. Each interface is designed to suit different visual impairments.
I have been trying to find a way to let the user load these from a combo box.
Is this something that is possible with PGM?

Many thanks.

That’s an interesting use case.
It is possible to replace the GUI programmatically. If you set a new ValueTree, the GUI should automatically follow immediately.

magicState.setGuiValueTree (BinaryData::other_magic_xml, BinaryData::other_magic_xmlSize);

You can advertise that to the GUI using the triggers.
However, I don’t know how that would work with the ComboBox, as that one would be destroyed too.
It would be easier to create it like a wizzard interface with next and previous buttons.

Does that sound like it could work?

I’ve been wanting to do this for a while also. I tried this much, and it works if I then use File / Refresh in the Editor. How do I refresh the layout programmatically?

Oh, I thought it would work by itself, but looking into the code, I don’t think.

I added a ValueTree::Listener, now it should update automatically.

Let me know if that works for you.

That’s great I will give it a try and let you know.
Many thanks.

It works!
That one-liner does it now.

I wonder if there is a way to cache the guiValueTree for faster load performance? I basically toggle between a “performance” layout and an “edit” layout (for iOS). They both contain substantially the same widgets and GuiItems, just a different layout, with many views hidden under TabButtons in the Performance case. The app comes up in Edit mode, and switching to Performance mode takes about 9 seconds. Switching back to Edit mode takes only 4 seconds, which is puzzling because Edit mode has many more visible items. Repeating the toggle gets the same times. I am measuring on a Debug build in Xcode on an M1 MacBook Pro. I’ll try iOS next, and look into cacheing the two gui-trees at launch time. Pointers welcome!

That sounds concerning. I will have a look at performance next.
There must some unnecessary rebuilds going on…

Thanks for the report