Cabbage Logo
Back to Cabbage Site

Widgets inside groupbox

When I have the following code:

groupbox bounds(13, 33, 965, 69), text(“track 1”){
button bounds(5, 25, 60, 25), channel(“but1”), text(“Push”, “Push”), colour(0, 0, 0, 255),
}

I would expect the button’s position to be relative to the groupbox. Instead it seems to have a position relative to the form. See attached screen shot.

Richard

Hi there,

You would need to make the groupbox into a ‘plant’. Once it’s a plant, you can have members positioned relative to it. Add an identifier plant("plantName") to your groupbox.

More info here: http://cabbageaudio.com/docs/plants/

Right, that’s it! Thank you. I do think this info should be in the documentation of the groupbox as well, though…

It is there is it not?
http://cabbageaudio.com/docs/groupbox/
Note that the plant() identifier will not needed in the new version of Cabbage. One only needs opening and closing curly brackets.

The first link to ‘plants’ appears in relation to popup. I think it should be mentioned in the description of bounds()…

I’m not sure, it has nothing to do with bounds? They stay the exact same whether it’s a plant of not. It would probably make more sense to mention in every other widget’s page that bounds are relative when used within a plant. But then this is made clear here.