Cabbage Logo
Back to Cabbage Site

Filebutton - Possible to change button hover colour?

Is there an attribute that I can change hover colour with?

#define BUTTON1 fontColour:0(“30,30,30”), colour:0(“200,200,200,0”), colour:1(“200,200,200,0”), outlineColour(“30,30,30”), outlineThickness(1), corners(0)

There is no native way to change colour on hover, but you could do something like this:

<Cabbage>
form caption("Untitled") size(400, 500), colour(58, 110, 182), guiMode("queue"), pluginId("def1")
keyboard bounds(10, 390, 381, 95)
image bounds(12, 10, 112, 34) channel("image1"), colour(0,0,0,0)
button bounds(26, 18, 80, 18) channel("button1"), colour:1(100, 0, 0, 255), colour:0(200, 0, 0)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d 
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1000
    SWidget, kTrig cabbageGet "CURRENT_WIDGET"
    if kTrig ==1 then
        if strcmpk(SWidget, "button1") == 0 then
            cabbageSet 1, "button1", "colour:0", 100, 0, 0, 255
        else
            cabbageSet 1, "button1", "colour:0", 200, 0, 0, 255
        endif
    endif    
endin

</CsInstruments>
<CsScore>
i1000 0 z
</CsScore>
</CsoundSynthesizer>