Local LAF Alert windows
-
So Im getting around to customising the look of my dialog/alert windows, but I cant get it to do anything here's my code :
// DIALOG POP UPS const var dialogLAF = Content.createLocalLookAndFeel(); dialogLAF.registerFunction("drawAlertWindow", function(g, obj) { g.fillAll(0xFF333333); var a = [0, 0, obj.area[2], 30]; g.setColour(0x44000000); g.fillRect(a); g.setColour(Colours.white); g.drawRect(obj.area, 0.3); g.setFont(skin.stdFont, 18); g.drawAlignedText(obj.title, a, "centred"); });
All I get back are the std look windows...
what am I doing wrong? -
You need to use global laf.
-
@d-healey I tried that here:
const var dialogLAF = Engine.createGlobalScriptLookAndFeel(); dialogLAF.registerFunction("drawAlertWindow", function(g, obj) { g.fillAll(0xFF333333); var a = [0, 0, obj.area[2], 30]; g.setColour(0x44000000); g.fillRect(a); g.setColour(Colours.white); g.drawRect(obj.area, 0.3); g.setFont(skin.stdFont, 18); g.drawAlignedText(obj.title, a, "centred"); });
Still nothing...
-
@Lindon This is what I see with your example (I don't have your font of course)
This is the standard one
-
@d-healey yeah very odd, working here now too, thanks..... ignore me everyone back on their heads...
-
@Lindon nope dont ignore me.....its broken somehow, it wont accept what Im entering:, here it is now:
const var laf = Engine.createGlobalScriptLookAndFeel(); laf.registerFunction("drawAlertWindow", function(g, obj) { g.fillAll(0xFF000000); var a = [0, 0, obj.area[2], 30]; g.setColour(0x44000000); g.fillRect(a); g.setColour(Colours.white); g.drawRect(obj.area, 0.3); g.setFont(skin.stdFont, 18); g.drawAlignedText(obj.title, a, "centred"); });
so the background should be black, and this is what I now get:
-
@Lindonaaaaand now its working again...mystified.......
-
@Lindon ....aaand now its failing again, its very broken I think.
-
@Lindon Odd, It seems to be random
-
It's working here in isolation, could it be some other part of your project that is interfering with it?
-
Try resetting the global look and feel (View -> Reset custom look and feel) before compiling.
But yeah, the global LAF is glitchy inside HISE - it's global and will be applied to all components and you might end up with some left over LAF from an older compilation.
-
@Christoph-Hart thanks I will try this...