You typically only call Bangle.drawWidgets() once at the end of the code to force each widget to redraw itself. The call to render will happen inside your draw() function. Thereafter each widgets decides when it will redraw itself.
var clockLayout = new Layout( {
// etc.
});
function draw() {
// etc
clockLayout.clear();
clockLayout.render();
}
g.clear();
// can put draw(); here
Bangle.setUI("clock"); // Show launcher when middle button pressed
Bangle.loadWidgets();
Bangle.drawWidgets();
draw();
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.
You typically only call Bangle.drawWidgets() once at the end of the code to force each widget to redraw itself. The call to render will happen inside your draw() function. Thereafter each widgets decides when it will redraw itself.