Cabbage Logo
Back to Cabbage Site

Changing outline color of filebutton and optionbutton

I can’t seem to be able to change the outline color of filebuttons or optionbuttons. I can set the outline color if outlineThickness is declared but not dynamically. See here - a regular button updates but not a filebutton (same with optionbutton)

<Cabbage>
form caption("Untitled") size(400, 300), guiMode("queue") pluginId("def1")

button bounds(20, 100, 100, 20), latched(1), channel("Button1"), text("Hi", "Bye"), automatable(0), fontColour:0("250,250,250,200"), fontColour:1("250,250,250"), outlineColour("250,250,250"), colour:0(0,0,0), outlineThickness(2), corners(0), automatable(1)
filebutton bounds(20, 130, 100, 20), latched(1), channel("File"), text("File", "Button"), automatable(0), fontColour:0("250,250,250,200"), fontColour:1("250,250,250"), outlineColour("250,250,250"), colour:0(0,0,0), outlineThickness(2), corners(0), automatable(1)

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1


instr 1
    cabbageSet metro(20), "File", sprintfk("outlineColour(%i,250,250)", 40)
    cabbageSet metro(20), "Button1", sprintfk("outlineColour(%i,250,250)", 40)
endin


</CsInstruments>
<CsScore>
;starts instrument 1 and runs it for a week
i1 0 [60*60*24*7] 
</CsScore>
</CsoundSynthesizer>

Let me take a look, should be an easy fix…

Fixed and pushed to git :+1:

Ahh cool. Thanks :blush:

yikes — Lore is crashing this version of Cabbage on compile.
My last working version is 2.8.155

It’s going to take me a while to dig out the culprit. Any chance you could look for a hint in the debugger?

EDIT 2.9.1 works 2.9.19 does not — trying out versions in between there…

If you can identify which version works that would be great.

Got it narrowed down 2.9.11 works 2.9.13 does not

one of the versions I downloaded had a really nice font! what happened to it?

You can change the font in the newer versions. One of those version wasn’t loading the default font, that’s probably the one you you opened. I’l check this out tomorrow. I an just clone the Lore repo right?

:+1:

But please don’t start digging in if it’s not obvious. I wouldn’t wish it on anyone to have to parse through all 800+ lines :joy:

I have been trying to sort out some weird behaviour with the state opcodes and filebuttons when changing sampling rates in a session in Bitwig and Studio One. This could be the cause. I’ll let you know once I’ve run it through the debugger.

1 Like

Can you try the latest build @chronopolis?

Yep — all seems to be working.

Another funny thing though — I cant seem to get filebuttons or optionbuttons to load into an array
for cabbageGetWidgetChannels I am using the macro $BUTTON1 to load all sliders and it’s getting all of them except for the filebuttons and optionbuttons :thinking: See here, only “Button1” is loaded into the array.

form caption("Untitled") size(400, 300), guiMode("queue") pluginId("def1")
#define BUTTON1 fontColour:0("250,250,250,200"), fontColour:1("250,250,250"), outlineColour("250,250,250"), colour:0(0,0,0), outlineThickness(1), corners(0), automatable(1)
button bounds(20, 100, 100, 20), latched(1), channel("Button1"), text("Hi", "Bye"), automatable(0), $BUTTON1
filebutton bounds(20, 130, 100, 20), latched(1), channel("File"), text("File", "Button"), automatable(0), $BUTTON1

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1


instr 1

Sbuttons[] cabbageGetWidgetChannels $BUTTON1
   printarray Sbuttons 
endin


</CsInstruments>
<CsScore>
;starts instrument 1 and runs it for a week
i1 0 1 
</CsScore>
</CsoundSynthesizer>```

Looks like the filters aren’t working for this widgets for some reason. Chase is on the case… :rofl:

It looks like filebutton doesn’t share the same identifiers as button. It certainly doesn’t share automatable(), that in itself will mess up the filters. But removing that doesn’t quite solve the problem. I’ll keep digging.

Scratch that, looks like the issue is that you’ve wrapped the RGB values in quotation marks…

Aha! It’s always the little things that throw me off for hours. Thanks for looking into it!

hmm — Even if I remove quotes and the other button, this still doesn’t print anything…

Edit — OK looks like it just needs a unique identifier in this case (eg _abutton(1))

Oh, in that case some local changes I made might help. I thought the problem was that filebutton didn’t have a default outlineThickness() value, which was messing up the filters. The most failsafe way to do this is to use unique identifiers. While testing this I found myself wanting an opcode that would print the value of every single identifier associated with a widget. I might add it to the list. It might be useful. It would have helped solve this case a little quicker.

1 Like

I think optionbutton is still not responding to outlineColour… filebutton works now but optionbutton does not.

new build just triggered… :+1:

1 Like