Cabbage Logo
Back to Cabbage Site

Phantom widgets

widgetarray seems to produce an extra widget. The code at the bottom produces 5 widgets where only 4 have been specified.
There’s also a bit of ambiguity in the docs entry for widgetarray: the code snippet uses ‘channelarray’ (which won’t work) instead of ‘widgetarray’.
The line in the first paragraph:
"Each identifier channel will have an ident string and number appended to them, e.g., chanident1, chan_ident2, etc. "
might be better as:
"Each identifier channel will have the string “_ident” and a number appended to them, e.g., chan_ident1, chan_ident2, etc. "
Then the first line in the second paragraph, after the code snippet:
"The first checkbox widget will have a channel named “test1”, and an ident-channel named “testident1”. The second widget channel will be named “test2”, while its ident-channel will be named “testident2”
should be something like:
"The first checkbox widget will have a channel named “test1”, and an ident-channel named “test_ident1”. The second widget channel will be named “test2”, while its ident-channel will be named “test_ident2”

<Cabbage>
form caption("Untitled") size(400, 400), colour(58, 110, 182), pluginid("def1")
checkbox bounds( 10, 10, 20, 20), shape("circle"), widgetarray("CBoxes", 4)
</Cabbage>

<CsoundSynthesizer>

<CsOptions>
-n -+rtmidi=NULL -M0
</CsOptions>

<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr  1
iCnt    = 1
while iCnt<=4 do
Spos  sprintf "pos(%d,10)", 10 + iCnt*50    ; create position message
SID   sprintf "CBoxes_ident%d", iCnt        ; generate ID string
      chnset  Spos, SID                     ; send message
iCnt  += 1
od
endin

</CsInstruments>

<CsScore>
i 1 0 3600
</CsScore>

</CsoundSynthesizer>

Thanks Iain, I’ll look into it and update the docs. I’ve a load of changes to the docs ready to go but haven’t had a chance to update. The start of the new term is always crazy.