Cabbage Logo
Back to Cabbage Site

cabbageSet combobox

There seem to be some issues with combox in v. 2.9.137.
I’m trying to use cabbageSet on combobox at initialization.

combobox bounds(20, 24, 160, 30) channel("combo1"), channelType("string")
cabbageSet "combo1", {{ items("one", "two", "three"), value("one") }}
cabbageSet "combo1", {{ colour(0,255,0,255) }}

  • When item is set to value(“one”) it always jumps to “three” (also with a mouse).
  • Colour and possibly other properties can’t be set.

Am I doing something wrong or is there a bug?

In my case cabbageCreate might be useful though. This seems to work:

cabbageCreate "combobox", {{bounds(20, 24, 160, 30) channel("combo1") items("one", "two", "three") value("one") colour(0,255,0,255) channelType("string")}}

Btw. a side question: before it was possible to insert a widget via mouse right click, which is not possible any longer. Intentionally?

Sure it’s possible, just enter edit mode and right-click?

I’m in the middle of a mountain of work here, but I’ll get around to your other question a little later today if I can :slight_smile:

that actually crashes Cabbage (MacOS Monterey 2.6.1).

No panic! I know you’re good at mountaineering :wink:

I haven’t heard any other reports of this. I’m on Ventura and I have no problems. Can you share a short screencast?

I believe you won’t see much here, but here it is (crash after right clicking).


edit: The same thing happens if I use the key short-cut (cmd+E) to enter edit mode.

The “hrange” type widget also exhibits this initialization behaviour.

I don’t have that crash going on on my system, but then again I never used right-click to add widgets.

One of my loops so far also doesn’t execute, may be the “init” vs “=”.

I’ll keep this post updated for the solutions.

I don’t rely on it either, it was just when preparing the demo that I wanted to right click :wink:
The cabbageSet and cabbageGetValue are the ones I really care about, but who knows what’s in the Cabbage gutters.

my “hrange” widget is a little modified, I set a separate label to show the actual value.

I had to increase the length of this and some other triggers (or even a separate global trigger at initialization lasting up to a second) in order to be recorded. Somehow the initialization doesn’t record it the way it did in 2.8.

I still have to look for the loops and other possible things that changed.

Sorry for the delay @Samo, some serious mountaineering going on here :rofl: I think the reason for this is quite simple, you can dynamically update the range of a widget. Let’s consider what’s going on with each snippet:

<Cabbage section....
combobox bounds(20, 24, 160, 30) channel("combo1"), channelType("string")

<CsoundSynthesiser...
cabbageSet "combo1", {{ items("one", "two", "three"), value("one") }}
cabbageSet "combo1", {{ colour(0,255,0,255) }}

In this case you create your combobox but don’t set any items, so the default items are given - as a combobox must have a range. So this will give undefined behaviour.


In the next piece of code you set the items when creating the combobox.

cabbageCreate "combobox", {{bounds(20, 24, 160, 30) channel("combo1") items("one", "two", "three") value("one") colour(0,255,0,255) channelType("string")}}

This, as you point out does work. FWIW, you’ll get the same issue using any widget that the host can interact with, as all their ranges must be fixed, and known to the host when the plugin is first instantiated. Does this make sense?

It makes perfect sense that items need to be set at “when the plugin is first instantiated”. I though that the init pass corresponds to this but it apparently doesn’t? And the automatable(0) doesn’t help either.

However, isn’t the colour suppose to set like it does for other widgets?

combobox bounds(20, 24, 160, 30) channel("combo1"), channelType("string"), items("one", "two", "three"), value("one")

cabbageSet "combo1", {{ colour(0,0,255,255) }}

Yes, this should work. I’m going to make myself a coffee and jump right into this. I might start with your init-time issue :+1:

1 Like

message delete - I posted in the wrong thread…

This should work again now. Sorry the delay in fixing!

1 Like