itemColour1 undefined
-
I have LAF like this:
const var ComboDropLAF = Content.createLocalLookAndFeel(); ComboDropLAF.registerFunction("drawPopupMenuBackground", function(g, obj) { var a = obj.area; var r = 3; //radius size g.setColour(Colours.white); g.fillRoundedRectangle([a[0], a[1], a[2], a[3]], r); g.setColour(obj.itemColour1); // border color var border = 1; //border thickness g.drawRoundedRectangle([a[0] + border, a[1] + border, a[2] - border*2, a[3] - border*2], r, border); }); const var AllComboBoxes = Content.getAllComponents("ComboBox"); for (m in AllComboBoxes) m.setLocalLookAndFeel(ComboDropLAF);
It was working fine, but since the latest HISE update, I am getting the following warning:
Interface:! Warning: undefined parameter 0 : LookAndFeel.js (234)
The line is:
g.setColour(obj.itemColour1); // border colorIt seems that it is not able to pull color from an object using "itemColour1". Trying "itemColour" yields the same warning.
What's happening here?
-
Are you sure it was working fine previously? I only ever see width and height available for the popup menu background.
-
@d-healey It was working fine. The colors were fine, and I was not getting any warnings. Now, I have to specify the colors in the script for both the itemColour and bgColour.
-
@gorangrooves Which commit was it working in?
-
@d-healey Uh, that was from Sep 27, 2023, which I last used. After that, I started getting warnings, so I didn't update HISE until yesterday.
-
@gorangrooves I just tried this commit from September 12th - 5515b685b321dee644837fb70660709ca283dccb
Still only see width and height.
Also just tried a build from 1st of October, same thing.
-
After that, I started getting warnings, so I didn't update HISE until yesterday.
Before it was the same problem, you just didn't realized it because there was no warning.
-
@Christoph-Hart OK. So, if I understand correctly, the colors for combo boxes were set in the actual combo boxes without the LAF, but there was no way to know since the results would have been identical. Correct?
-
So, if I understand correctly, the colors for combo boxes were set in the actual combo boxes without the LAF
I just reread your exampe and noticed you were using the popup menu LAF functions. The popup menu is not part of the combobox component, so there are no colours in the
obj
parameter.A good practice for anything regarding LAF customization is to always use
Console.print(trace(obj))
as first line of the function, then you'll see everything you can work with.