You are reading a single comment by @Alessandro and its replies. Click here to read the full conversation.
  • 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 (OneOne11111, TwoTwo22222:

    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

    • screenshot (1).png
    • screenshot (2).png
About

Avatar for Alessandro @Alessandro started