Open Enyium opened 2 months ago
I haven't investigated this bug yet, but i have the feeling this is because we assign property and call init callback in the wrong order.
The Slint docs says we should not assign properties on Init Function.
Don’t use this callback to initialize properties, because this violates the declarative principle.
I would like to know if that is a different case for this bug?
I tried the link and this is what I see:
(Mobile Safari)
What am I missing?
Timer shouldn't run,\nand interval should be\nlonger than 1s:
since he set the timer.running = false;
on Init function he expects the timer not be running. t.text should not be changing.
Got it - thanks :)
When the frames are rendered, the timer properties evaluate to the correct value. The timer is still running though, which leads me to believe that the issue is with the change callbacks that aren’t triggered, and thus the timer keeps on running and is never stopped.
Don’t use this callback to initialize properties, because this violates the declarative principle.
"because this violates the declarative principle" is something completely different than "Don't expect this to work." There may be edge cases where it's needed or useful.
Consider this SlintPad demo (see its rendered output):