Different repaint methods explaination please...
-
Simple question....What is the difference between these three?
.repaint(); .sendRepaintMessage(); .repaintImmediately();
They all seem to do the same thing when I use them but im sure the nuances make a difference.
Thanks!
-
.repaint()
is asynchronous, which means it's not real-time, HISE will do it when it gets around to it..repaintImmediately()
says, stop everything and do the repaint now.The two above are for panels
sendRepaintMessage()
is asynchronous (like .repaint()) and can be used with all other components that use laf. -
@d-healey actually repaint and repaintImmediately do the same thing now - this distinction was before I rewrote the threading model. Both will execute the code on the scripting thread (and if the call is made on the scripting thread it will be executed right after the current function call), then a list of paint directives is created and sent to the UI thread where it renders the interface).
-
@Christoph-Hart Api doc needs updating
-
@Christoph-Hart @d-healey Thank You
-
I think
repaintImmediately()
can be considered deprecated for so long that it can be safely removed. A project that old won't open anyway with current versions for a thousand other reasons...@Christoph-Hart While we're around, is there an improvement in drawing in the paintRoutine function vs inline ? since they're both called from a non-inline? My guess is that at least what is called inside the
inline
will be faster, but the maybe not the rendering in the end...Panel.setPaintRoutine(function(g) { var... }); // versus Panel.setPaintRoutine(function(g) { doSomething(); }); inline function doSomething() { local... }
-
@ustk Yeah I would just hide it in the api browser and autocomplete, then it can quietly disappear.
-
@ustk itβs a bit faster but the main advantage is that you can use local variables which are more tightly scoped.
-
I think repaintImmediately() can be considered deprecated for so long that it can be safely removed. A project that old won't open anyway with current versions for a thousand other reasons...
If I deprecate it I would have to make it so that it throws a compilation error at the script parsing stage, not only when it's actually called as this could go through unnoticed, but yeah I agree that this could be part of a nice cleanup session along with other things that are completely out of date
-
@Christoph-Hart isn't a laptop a mobile device by definition? lol