Cabbage Logo
Back to Cabbage Site

Option button color indexes not working

When I’m setting optionbutton colors other than colour:0 (i.e. colour:1, colour:2, etc…), they’re not taking. No matter what I set them to, they all use the color:0 setting. Same for fontcolour:0, 1, 2 ...

I think there is some misleading info in the docs for this one. The optionsbutton doesn’t have ‘off’ or ‘on’ colours. Are you trying to give each state a different colour?

Yes, I’m trying to set a different color for each state.

It could be done like this?

instr 1

    iCol[][] init 3, 3
    iCol fillarray    55, 155, 100,\
                      155, 55, 100,\
                      25, 0, 100
                      
    kButton, kTrig cabbageGetValue "button1"
    cabbageSet kTrig, "button1", "colour:0", iCol[kButton][0],iCol[kButton][1],iCol[kButton][2]

endin

Thanks. No worries. I thought the docs were saying this happened automatically :slight_smile:

No, what they actually say is ‘Rory update the docs you lazy bas***d’

1 Like