I'm studying the tutorials and I have run into something unexpected.
This is the code taken from Layout tutorial. I only changed the setLabel text (One → One11111, Two → Two22222:
setLabel
One
One11111
Two
Two22222
var Layout = require("Layout"); var layout = new Layout({ type: "v", c: [{ type: "txt", font: "6x8:2", label: "A Test", id: "label" }, { type: "btn", font: "6x8:2", label: "One", cb: l => setLabel("One11111") }, { type: "btn", font: "6x8:2", label: "Two", cb: l => setLabel("Two22222") } ] }, { btns: [{ label: "Three", cb: l => setLabel("Three") }], lazy: true }); function setLabel(x) { layout.label.label = x; layout.render(); } g.clear(); layout.render();
After the second click the label gets dirty (both on emulator and physical device). What's wrong?
2 Attachments
@Alessandro 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.
I'm studying the tutorials and I have run into something unexpected.
This is the code taken from Layout tutorial. I only changed the
setLabel
text (One
→One11111
,Two
→Two22222
:After the second click the label gets dirty (both on emulator and physical device). What's wrong?
2 Attachments