This looks pretty neat, hopefully I'll have some time to play with it this weekend.
Would it be bloaty to add something like this (untested):
Layout.prototype.setLabel = function(id, label) { var l = this._l; if (l[id].label !== label) { this.clear(id); l[id].label = label; render(id); } }
(or even add it to txt/btn elements, so you could just do layout.date.setLabel('New label'))
txt
btn
layout.date.setLabel('New label')
Just because I expect otherwise the compare-clear-update-render code will probably show up in pretty much all apps anyway.
compare-clear-update-render
@rigrig started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This looks pretty neat, hopefully I'll have some time to play with it this weekend.
Would it be bloaty to add something like this (untested):
(or even add it to
txt
/btn
elements, so you could just dolayout.date.setLabel('New label')
)Just because I expect otherwise the
compare-clear-update-render
code will probably show up in pretty much all apps anyway.