r/Scriptable • u/Tasty-Albatross-5624 • Oct 17 '21
Discussion Widget Stack memory limit
Hi,
I'm trying to understand Scriptable's memory limitation on the number of stacks. I did a simple test with this piece of code:
const max = 175; const widget = new ListWidget(); widget.setPadding(0, 0, 0, 0) widget.addText(max.toString()); let main = widget.addStack(); main.layoutHorizontally();
for(let i = 1; i < max; i++) { let s = main.addStack(); s.addText(i.toString()); s.borderWidth = 1; s.borderColor = Color.red(); main.addSpacer(1); }
Script.setWidget(widget);
When I exceed 165 stack the widget no longer updates.
I also use Widgy to make other widgets and we don't seem to face that kind of limitation.
Is the limit in memory or in number of layers?
Thanks.
View all comments
1
u/mvan231 script/widget helper Oct 18 '21
I have experienced something like this as well but never really figured out the exact number of stacks that it took to cause the error