Execution timed-out
-
@Christoph-Hart Do You Have Any Idea Over This?
-
I Guess We Are In The Same Frequency :/
@andioak said in Finally: Fully customize stock UI elements with a scripted LookAndFeel:
While trying to add a customization I seem to get an infinite loop:
laf.registerFunction("drawToggleButton", function(g, obj) { var blue = "0xFB00A6C9"; var yellowish = "0xFBB4CF0C"; if(obj.text == "Button1") // accessing only one of the item for a special color, or anything: { Console.print("object id is button1"); // this code keeps repeating over and over... ? g.setColour(yellowish); // custom color only here. } else { g.setColour(blue); } g.fillRoundedRectangle(obj.area, 4.0); if(obj.over) g.fillRoundedRectangle(obj.area, 4.0); if(obj.down) g.fillRoundedRectangle(obj.area, 4.0); g.setColour(Colours.withAlpha(obj.textColour, obj.value ? 1.0 : 0.3)); g.setFont("Arial Bold", 12.0); g.drawAlignedText(obj.text, obj.area, "centred"); });
The
if (obj.text == "Button1")
is processed all the time and always returns true, even though there is only one single item with that name.UPDATE: after testing the same if-types as already used in the hise docs copy-paste that this one is made from, it works if I remove the
Console.print()
and replace the if statement with this only:... g.setColour(blue); if(obj.text == "Button2") g.setColour(yellowish); ...
Is that how this was intended to be used only? Is there an issue with the Console? Not being handled in that stage?
-
-
@d-healey It's Not The Cause Of This Issue Sir.
Check The Above Post That I Posted With Youtube Link.8000, Yeah Because All Of My UI Designed Using Vectors SVG Files.
I Worked Around 1 Year Over This Masterpiece
With Just 10 Panels You Simply Reach To 2k In Code Lines. -
@Natan Are you using namespaces to break up your code?
-
Only Two, One For The Serial Number Authorization, And One For VU Meter Whcih I Removed From The Code To Solve The Time Out Issue.
Just Replaced It With Another One, And NO Time Out Error Shows Up So Far.
-
@Natan 8000 lines in two namespaces! That's double crazy.
@d-healey It's Not The Cause Of This Issue Sir.
Correct, but it makes it a whole lot harder to debug and maintain, and almost certainly your code needs some optimisation. Start by creating one namespace for each of your main panels, this will make things much simpler.
-
@d-healey No No No
Sir
There Is Nothing Inside Namespace Other Than Authorisation script.Everything Scripted Just In Normal Way.
-
Everything Scripted Just In Normal Way.
Nothing normal about 8000 lines in one file! Unless it's ALL svg arrays I guess.
I need to make a video!
-
@d-healey Yeah Thank You Sir
It Mostly SVG Codes Which Turned My Project To A Beast.
BTW The Load Time Is Under 1 Sec In All Daw's.
Very Smooth Plugin -
The custom LAF is not absolutely stable. It is at the moment the main crashing reason on my side. To overcome this I generally develop without and activate it the later I can.
I’ve never found a way to point at the reason it crashes as all my attempts showed me it is always something else...
However @Christoph-Hart said a few weeks ago that one should definitely not use external variables in a custom LAF or sure it will cause some troubles.
About that I still have no answer if we can use external colour values or if this enters in the same paradigm, And what about using a loaded path...