You are reading a single comment by @GRikell and its replies. Click here to read the full conversation.
  • Hi Al,
    it seems that the Layout module has a problem, perhaps related to new handling of let/const of v14 firmware.
    When rendering on a Bangle2 a layout with more than one button, the following message is diplayed:

    Uncaught ReferenceError: "BTN2" is not defined
     at line 115 col 79 in Layout
    ...pressHandler.bind(this,1), BTN2, {repeat:true,edge:-1}));
    in function "setUI" called from line 65 col 14 in Layout
    in function "Layout" called from line 373 col 14 in Layout
    ], lazy:true});

    This happens even running the sample code available in the tutorial, e.g.:

    var Layout = require("Layout");
    var layout = new Layout( {
      type:"v", c: [
        {type:"txt", font:"6x8:2", label:"A Test", id:"label" }
    }, {btns:[
      {label:"One", cb: l=>print("One"),  cbl: l=>print("One long press")},
      {label:"Two", cb: l=>print("Two")},
      {label:"Three", cb: l=>print("Three")}
    ], lazy:true});
    function setLabel(x) {
      layout.label.label = x;

    I'm pretty sure that it worked on v13.


Avatar for GRikell @GRikell started