Cabbage Logo
Back to Cabbage Site

Cabb2 : button update (fixed)

Hello,
I am trying to change the status of a button from another button :
If the second button is clicked, then the first one comes back to initial state but in a deactivated.one.
When sending the " active(0), val(0)" , only the color is updated but not the text.
Do I do something wrong or is this a little bug in cabb2 ?
I attach a very simple demonstrate it.
Thanks for help.
Cs-test-Button.csd (1.1 KB)

I won’t be able to look into this till Monday. Thanks for the report.

This is fixed now in GIT. I’ll upload new binaries when I get a chance. Note that because buttons take two strings, for on and off, you should probably do something like this:

SMessage sprintfk "text(\"Toto\", \"Noto\"), active(%d), value(%d)", 0, 0

If you just pass a single string, that will be used for both on and off labels.

Hi Rory,

In Cabbage2, the " latched()" parameter is puzzling me.
I would expect the following button

button bounds(325,1,60,17), text(“R E S E T”,“R E S E T”), channel(“BReset_1”) colour:0(“DarkOrchid”) colour:1(“Yellow”) latched(0)

to be of color DarkOrchid, then when clicked turned briefly to “Yellow” and then back to DarkOrchid.
As well as not remaining in a “1” state after mouse is release… but it doesn’t seem to be the case. Could you please advise about that (maybe i don’t understand the latched parameter)?

I am looking for a button which only send a trigger when clicked and which does not remain in that state when the click is release (back to the Off value). Actually , cabbage buttons seem to behave like toogle button (either ON or OFF state) and not like trigger buttons (Always "Off ", except once clicked, sending short “On” message)
Thank you for your help

That’s what latched should do. I’ll get that sorted. Thanks for reporting!

This is now fixed in git. I’ll roll these changes into a new binary soon.