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
Show parent comment
2
u/Trevor_in_Holland Nov 15 '21
Definitely an issue and goo to know that wasnt alone with the problem.
Managed to split my single large widget that had a lot going on (sunsrise, sunset, weather, calendar, stock market, covid, # of new mail, etc) into 3 separate smaller widgets and they all independently seem to update regularly. Shame as takes up more space and have multiple "scriptable" labels you can't get rid of.