Cabbage Logo
Back to Cabbage Site

Dynamically loading listbox string

Ok, now I see what you’re at. But no, you can’t pick and choose Cabbage presets this way. In fact, Cabbage is likely to crap its pants if you even try selecting one of these presets considering the current GUI doesn’t contain all of these widgets/channels.

If you want to do this kind of thing you’re need to roll your own preset system. There is quite a discussion about this here. The tr;dr is that you will need to manage your own presets if you want this kind of flexibility. But there are some opcodes that can help, namely cabbageChannelStateSave and cabbageChannelStateRecall. Together with various file/string opcodes you should be able to put together a fairly robust preset system. But you have to ask yourself is it worth the effort because, it does quite a bit of complexity to the system.

I see - OK, will have to think about that. It will just be a strange UX in my particular case, for the user to choose a new library and the list of presets associated w it doesn’t show up by default… Yes, in this example, the widgets don’t align with the snap but in my working files it does… indeed cabbage crashes if you try and select one :slight_smile:

Hmm still struggling with this… maybe i’m missing something in the syntax…

// This one loads the image
cabbageSet "Wallpaper", "file(\"Flare_2000.png\")" 

// This one does not load even though the file is in the images folder
;cabbageSet "Wallpaper", "file(\"images/Flare_2000.png\")" 

endin

Change the images folder to imoges and it works :rofl: Sorry. Bug. Fixed. I didn’t catch it before because my folder didn’t contain the name of widgets. I was optimising some code yesterday and stupidly introduced this.

Ahhh - there’s nothing like a beautiful imog :laughing: