Cabbage Logo
Back to Cabbage Site

Is it possible to embed a groupbox within a groupbox?

I was wondering if it would be possible to switch different groups of a gui in and out (by using tofront()), but having those parts also embedded within another group.

This also bring up another topic of how we address sending “tofront()” to anything, as the documentation says we should send that to an “identchannel”, but the new gui queue seems to want to eliminate the need for “identchannel”…

Hope this makes sense, as it is addressing two different things…

What I usually do is place my plants on top of each other, and then use visible(0/1) to show or hide them. Here is an example.

Guess I was just thinking of one operation. Do plants work like groups? I’ve only been concentrating on learning other things…

Ha, I’d forgotten about the toFront() identifier. That would probably do trick, if it’s still working :thinking: It’s a long time since I used it…

But that’s the thing… The documentation says that tofront only works with an identifier channel, and if we’re using the queue gui mode, then do identifier channels disappear? Either way, if visible is available to call using the channel (and not the identifier channel), then all is good. Just one step closer to that magically disappearing and reappearing gui!

Sorry, all identifiers can be used with the new system. I’m almost finished updating the docs. I’m working on that right now as it happens.

Well, that’s a horse of a different color! If you say they work, I’m going to have to work on this again tonight, because nothing I did last night worked… I tried using tofront in any number of ways, on both the channel and the identchannel… I’ll let you know and if need be, I’ll post some code…

I’ll try it now and let you know. Give me a sec…

Yes, there was an issue there. It works now.


I’ve triggered a new build. It should be ready in about 40 minutes. Thanks for reminding me of that one :rofl:

(patting self on back) yes! Glad to be of service! :smile:

It’s also nice to know that we can use “sprintfk” as a call within the cabbageSet opcode itself!

I remember seeing @t_grey use sprintfk inline like this in some of his instruments and thinking I’m definitely robbing that :rofl:

2 Likes

“some of my instruments”… :rofl: I use it just about everywhere!

I really need to get back to playing with these new cabbage versions and features. I’ve put off converting because I ran into a hiccup with one or two of my instruments, started chasing that down a rabbit hole and got distracted elsewhere in the process.

<Cabbage>
form caption("SubGroups") size(400, 300) guiMode("queue") colour(58, 110, 182) pluginId("def1")

image bounds(20, 20, 200, 200) outlineThickness(2) outlineColour("Red")
{

label bounds(20, 20, 120, 10) align("left") text("First in Universe")

image bounds(20, 40, 100, 100) outlineThickness(2) outlineColour("Orange") channel("orange")
{

}
image bounds(20, 40, 100, 100) outlineThickness(2) outlineColour("Blue") channel("blue")
{

}

combobox bounds(20, 160, 100, 10) align("left") items("orange", "blue") channel("select")
}

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

;instrument will be triggered by keyboard widget
instr 1
    kSelect, kSelectTrig cabbageGet "select"
    if kSelectTrig == 1 then
        printsk "kSelectTrig: %d kSelect: %d\n", kSelectTrig, kSelect
        if kSelect == 1 then
            printsk "kSelect: 1\n"
            cabbageSet k(1), "orange", "toFront(1)"
        elseif kSelect == 2 then
            printsk "kSelect: 2\n"
            cabbageSet k(1), "blue", "toFront(1)"
        endif
    endif
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
i1 0 -1
f0 z
</CsScore>
</CsoundSynthesizer>

So, I promised code… It appears that subgroups within groups of groups of other things will work. But I make no promises!

(I’m currently listening to Tarkus by ELP!)

(Shouldn’t that be a requirement, that we say what music we are listening to while we’re posting?)

Ok, I’ve wasted enough of your time. Until next time!

Thread carefully with that :rofl: Glad to hear it’s working. I need to update the docs again :roll_eyes: I’ll never be done with this blasted docs :laughing:

Nice. I have it now too!

1 Like